You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to import setuptools from an egg in a virtualenv environment I am seeing this error:
>>> import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/tmp/test/setuptools-42.0.0/setuptools-42.0.0-py3.6.egg/setuptools/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 894, in _find_spec
File "/tmp/salt-tests-tmpdir/tmp8v5ucrk2/psetuptools/lib/python3.6/site-packages/_virtualenv.py", line 64, in find_spec
setattr(spec.loader, func_name, partial(func, old))
AttributeError: 'zipimport.zipimporter' object attribute 'load_module' is read-only
a) wget https://pypi.io/packages/source/s/setuptools/setuptools-42.0.0.zip
b) unzip setuptools-42.0.0.zip
c) cd setuptools-42.0.0
d) python setup.py -q bdist_egg --dist-dir .
Try to import setuptools with egg in sys.path
(issue-20.0.10) ch3ll@thecakeisalie /tmp/setuptools-42.0.0 python -c "import sys; sys.path.insert(0, '/tmp/setuptools-42.0.0/setuptools-42.0.0-py3.7.egg'); import setuptools"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
File "/tmp/setuptools-42.0.0/setuptools-42.0.0-py3.7.egg/setuptools/__init__.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 963, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 906, in _find_spec
File "/tmp/issue-20.0.10/lib/python3.7/site-packages/_virtualenv.py", line 64, in find_spec
setattr(spec.loader, func_name, partial(func, old))
AttributeError: 'zipimport.zipimporter' object attribute 'load_module' is read-only
ch3ll@thecakeisalie ~/git/virtualenv ➦ 93cf9ed <B> pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
appdirs (1.4.3)
certifi (2019.11.28)
chardet (3.0.4)
colorlog (3.2.0)
distlib (0.3.0)
filelock (3.0.12)
idna (2.8)
importlib-metadata (1.5.0)
nox-py2 (2019.6.25)
pip (9.0.3)
py (1.8.1)
pyprof2calltree (1.4.4)
pyzmq (18.1.1)
requests (2.23.0)
setuptools (41.2.0)
six (1.14.0)
tornado (4.5.3)
urllib3 (1.25.7)
virtualenv (20.0.10)
zipp (3.1.0)
You are using pip version 9.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The text was updated successfully, but these errors were encountered:
Hello, a fix for this issue has been released via virtualenv 20.0.11; see https://pypi.org/project/virtualenv/20.0.11/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-11-2020-03-18). Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release.
pypa
locked and limited conversation to collaborators
Jan 14, 2021
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue
When attempting to import
setuptools
from an egg in a virtualenv environment I am seeing this error:Steps to reproduce:
a)
wget https://pypi.io/packages/source/s/setuptools/setuptools-42.0.0.zip
b)
unzip setuptools-42.0.0.zip
c)
cd setuptools-42.0.0
d)
python setup.py -q bdist_egg --dist-dir .
sys.path
And when on virtualenv 16.4.3 it works just fine:
Environment
Provide at least:
The text was updated successfully, but these errors were encountered: