Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows, Python 3.8: 'python -m pip install' pulls wrong version when run from VS command prompt #1609

Closed
luciansmith opened this issue Jun 29, 2020 · 1 comment

Comments

@luciansmith
Copy link

@luciansmith luciansmith commented Jun 29, 2020

Describe the bug

After downloading Python 3.8 for Win64 and installing locally, running it and asking it to use pip to install a package such as numpy gets the 32-bit version and not the 64-bit version.

To Reproduce
Steps to reproduce the behavior:

  1. Have VS 2019 installed with its default Python support.
  2. Install 64-bit Python 3.8
  3. Run 'Python38/python.exe -m pip install numpy'
  4. Notice that it's downloaded the 32-bit version.
  5. Run 'Python38/python.exe'
  6. 'import numpy'
C:\Users\Lucian\Desktop\Numpy Wheels>C:\Users\Lucian\AppData\Local\Programs\Python\Python38\python.exe -m pip install numpy
Collecting numpy
  Using cached numpy-1.19.0-cp38-cp38-win32.whl (10.9 MB)
Installing collected packages: numpy
  WARNING: The script f2py.exe is installed in 'C:\Users\Lucian\AppData\Local\Programs\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.19.0

C:\Users\Lucian\Desktop\Numpy Wheels>C:\Users\Lucian\AppData\Local\Programs\Python\Python38\python.exe
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Lucian\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\__init__.py", line 138, in <module>
    from . import _distributor_init
  File "C:\Users\Lucian\AppData\Local\Programs\Python\Python38\lib\site-packages\numpy\_distributor_init.py", line 26, in <module>
    WinDLL(os.path.abspath(filename))
  File "C:\Users\Lucian\AppData\Local\Programs\Python\Python38\lib\ctypes\__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Expected behavior
The -m pip install line should install numpy-1.19.0-cp38-cp38-win_amd64.whl

Instead, it downloads and installs numpy-1.19.0-cp38-cp38-win32.whl

If you download numpy-1.19.0-cp38-cp38-win_amd64.whl by hand and use that filename instead of just 'numpy', it will refuse to install it:

C:\Users\Lucian\Desktop\Numpy Wheels>C:\Users\Lucian\AppData\Local\Programs\Python\Python38\python.exe -m pip install numpy-1.19.0-cp38-cp38-win_amd64.whl
ERROR: numpy-1.19.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

Note that it is actually using the newly-installed version of pip: it will complain that I am using an outdated version of pip and suggest that I install the latest version, and when I do, it stops complaining.

The exact same commands work fine from a cygwin window or a 'cmd' window.

The same commands also work for Python 3.6 and 3.7 in a VS2019 command prompt: it is something Python 3.8-specific.

@zooba
Copy link
Member

@zooba zooba commented Jul 6, 2020

Hard to say why pip thinks it's a 32-bit Python when Python is clearly a 64-bit interpreter, but this is definitely not the right bug tracker - this is for the python.org website, not for Python or pip.

It wouldn't surprise me if you had a copy of pip in your Numpy Wheels directory, or a PYTHONPATH setting that is pointing at the invalid pip. But you're probably best to ask at https://github.com/pypa/pip rather than here.

@ned-deily ned-deily closed this Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.