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

Python 3.8 wheels fail to install on Windows #6885

Closed
chrahunt opened this issue Aug 16, 2019 · 1 comment
Closed

Python 3.8 wheels fail to install on Windows #6885

chrahunt opened this issue Aug 16, 2019 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific type: bug A confirmed bug or unintended behavior

Comments

@chrahunt
Copy link
Member

Environment

  • pip version: 19.2.2
  • Python version: 3.8b3
  • OS: Windows 10

Description

As described by @rdb in pypa/packaging#180:

On Windows, pip fails to install binary wheels with the following error:

ERROR: mypackage-1.0.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

Expected behavior

pip installs wheels with Python 3.8.

How to Reproduce

:: Goes through (but fails because it is not a zip) even though the ABI tag cp38m is not valid
echo > project-0.1.0-cp38-cp38m-win_amd64.whl
pip install ./project-0.1.0-cp38-cp38m-win_amd64.whl
:: Fails to consider this file even though it has the valid cp38 ABI tag
echo > project-0.1.0-cp38-cp38-win_amd64.whl
pip install ./project-0.1.0-cp38-cp38-win_amd64.whl

Output

(.venv) C:\Users\User\Desktop\test>echo > project-0.1.0-cp38-cp38m-win_amd64.whl

(.venv) C:\Users\User\Desktop\test>pip install ./project-0.1.0-cp38-cp38m-win_amd64.whl
Processing c:\users\user\desktop\test\project-0.1.0-cp38-cp38m-win_amd64.whl
ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\legacy_resolve.py", line 196, in resolve
    self._resolve_one(requirement_set, req)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\operations\prepare.py", line 195, in prepare_linked_requirement
    unpack_url(
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\download.py", line 1051, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\download.py", line 985, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\utils\misc.py", line 732, in unpack_file
    unzip_file(
  File "c:\users\user\desktop\test\.venv\lib\site-packages\pip\_internal\utils\misc.py", line 612, in unzip_file
    zip = zipfile.ZipFile(zipfp, allowZip64=True)
  File "C:\opt\python.3.8.0-b3\tools\lib\zipfile.py", line 1232, in __init__
    self._RealGetContents()
  File "C:\opt\python.3.8.0-b3\tools\lib\zipfile.py", line 1299, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

(.venv) C:\Users\User\Desktop\test>echo > project-0.1.0-cp38-cp38-win_amd64.whl

(.venv) C:\Users\User\Desktop\test>pip install ./project-0.1.0-cp38-cp38-win_amd64.whl
ERROR: project-0.1.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.

Details

In pep425flags here when constructing our ABI tag, we check:

  1. if sysconfig.get_config_var('SOABI'), then use that
  2. otherwise, if sysconfig.get_config_var('WITH_PYMALLOC'), add m
  3. otherwise, if we're running CPython, add m

On Windows, neither SOABI or WITH_PYMALLOC are defined, so then we unconditionally add m to our required ABI tags for CPython. But this is incorrect since m was removed from the ABI as part of 3.8 per bpo-36707.

On macOS and Linux we already have the correct tag since SOABI is defined.

See also

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Aug 16, 2019
@chrahunt chrahunt added OS: windows Windows specific type: bug A confirmed bug or unintended behavior labels Aug 16, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Aug 16, 2019
@chrahunt
Copy link
Member Author

Closed by #6874.

rdb added a commit to panda3d/panda3d that referenced this issue Aug 17, 2019
A proper fix for this has been merged in pip already (pypa/pip#6874), so this hack will only exist until pip 19.2.3 is out.
miss-islington pushed a commit to python/cpython that referenced this issue Aug 26, 2019
/cc @ambv since this needs to be included in 3.8 -- see pypa/pip#6885.

Sorry about the last minute PR!


https://bugs.python.org/issue37664



Automerge-Triggered-By: @zooba
lisroach pushed a commit to lisroach/cpython that referenced this issue Sep 10, 2019
/cc @ambv since this needs to be included in 3.8 -- see pypa/pip#6885.

Sorry about the last minute PR!


https://bugs.python.org/issue37664



Automerge-Triggered-By: @zooba
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Sep 16, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation OS: windows Windows specific type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant