question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.10: pip installs wheel for ancient Python versions

See original GitHub issue

Description

I am the current maintainer of py2exe https://github.com/py2exe/py2exe and I still have not released a version of the package for Python 3.10,

However, users reported that they were able to install the package on their system. When questioned, they reported that pip first tries to install from some old sources (py2exe-0.10.0.2.tar.gz). I am sure this is my fault and setup.py is not proper there, and I intend to delete this rogue release.

Unfortunately, after this failed attempt, pip picks an even older wheel which is not compatible at all with 3.10 (py2exe-0.9.2.2-py33.py34-none-any.whl) and claims that the package was successfully installed.

I can delete the rogue 0.10.0.2 source archive, but I would like not to delete also all the releases before that one. Could you tell me why this is happening and if is there anything, besides deleting all past releases, that I can do?

Thank you for your assistance

Expected behavior

pip should either say that no version compatible with the platform was found or try to install from the source archive and fail due to the lack of dependencies/compiler.

pip version

21.3.1

Python version

3.10.0

OS

Microsoft Windows [Version 10.0.17763.2183]

How to Reproduce

pip install py2exe

Output

C:\>pip install py2exe
Collecting py2exe
  Downloading py2exe-0.10.0.2.tar.gz (104 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 104 kB 6.8 MB/s
  Preparing metadata (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\pip-install-lyc0or4x\\py2exe_b12f490fb2d949
048ed23d41020dcdaf\\setup.py'"'"'; __file__='"'"'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp\\pip-install-lyc0or4x\\py2exe_b12f490fb2d949048ed23d41020dcdaf\\setup.py'"'"';f = getattr(token
ize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(
compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-pip-egg-info-wcv280uo'
       cwd: C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\
  Complete output (17 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\setup.py", line 17, in <module>
      from py2exe.py2exe_distutils import Dist, Interpreter, BuildInterpreters
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\__init__.py", line 9, in <module>
      patch_distutils()
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\patch_distutils.py", line 68, in patch_distutils
      from . import distutils_buildexe
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\distutils_buildexe.py", line 91, in <module>
      from . import runtime
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\runtime.py", line 3, in <module>
      from .dllfinder import Scanner, pydll
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\dllfinder.py", line 6, in <module>
      from . import pescan
    File "C:\Users\ContainerAdministrator\AppData\Local\Temp\pip-install-lyc0or4x\py2exe_b12f490fb2d949048ed23d41020dcdaf\py2exe\pescan.py", line 12, in <module>
      import pefile
  ModuleNotFoundError: No module named 'pefile'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/7d/2b/5bb512a67aaa465f8629f2c0d759f56b8136a973b355db32870beb5c76af/py2exe-0.10.0.2.tar.gz#sha256=40d785a92c85908c4829bcfd4ae9985d20dcdb805e5
0097c8cba78608b06a81c (from https://pypi.org/simple/py2exe/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading py2exe-0.9.2.2-py33.py34-none-any.whl (270 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 270 kB 6.4 MB/s
Installing collected packages: py2exe
Successfully installed py2exe-0.9.2.2

Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
albertosottilecommented, Oct 30, 2021

I just created PR #10625 with the proposed change.

0reactions
uranusjrcommented, Oct 29, 2021

I think this would be a good change since it fixes a real issue (the one we have here), and those negatively impacted have a relatively easy way out (by adding a package==version pin). This needs to go through the normal deprecation process, but we can talk about how that’d work in the PR.

Regarding the implementation, the simplest design would be to only allow a yanked distribution only if the user uses == (or ===). This can be pretty easily done by checking the content of specifier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install, download and build Python wheels - ActiveState
Python Install Wheel ; Assuming you don't first need to install Python from python.org, you can install a wheel by running the following...
Read more >
Installing pip/setuptools/wheel with Linux Package Managers
This section covers how to install pip, setuptools, and wheel using Linux package managers. If you're using a Python that was downloadedΒ ...
Read more >
Optimize pip install with wheels - Roman Imankulov
The package doesn't have wheels at all. You may consider politely asking the maintainer to issue a new version with a wheel. You...
Read more >
Does installing a local wheel with extras work on Python 3.11?
I figured out why this was happening. A part of my requirements file looks like this: numpy>=1.21.6 ; python_version >= '3.10' # Python...
Read more >
How to Install PIP on Windows: A Simple Guide with ...
pip 22.0.2 from C:\Users\Utente\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found