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
$ /tmp/venv/bin/python -c 'import pip; print(pip.__version__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 982, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 925, in _find_spec
File "/private/tmp/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 83, in find_spec
return method()
File "/private/tmp/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 104, in spec_for_pip
if self.pip_imported_during_build():
File "/private/tmp/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 115, in pip_imported_during_build
return any(
File "/private/tmp/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 116, in <genexpr>
frame.f_globals['__file__'].endswith('setup.py')
KeyError: '__file__'
Expected behavior
Ideally, pip should load as a module without issue.
That _distutils_hack file isn't part of pip, so this isn't a pip issue. It looks like the file is installed by setuptools, so maybe report this to setuptools?
Description
After upgrading
setuptools
, I'm no longer able to importpip
as a module within a Python REPL. This is on macOS, using Python 3.9.9 from Homebrew.Running this, I see:
Expected behavior
Ideally,
pip
should load as a module without issue.pip version
21.3.1
Python version
3.9.9
OS
macOS 12.1
How to Reproduce
See above.
Output
See above.
Code of Conduct
The text was updated successfully, but these errors were encountered: