[MacPorts] #59746: ModuleNotFoundError: No module named 'pip._internal'
MacPorts
noreply at macports.org
Fri Nov 22 07:08:37 UTC 2019
#59746: ModuleNotFoundError: No module named 'pip._internal'
-------------------------+--------------------
Reporter: ParityError | Owner: (none)
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version:
Keywords: | Port:
-------------------------+--------------------
I have an issue after using `port select` with `pip`; it seems I have to
invoke `sudo` for any `pip` command, otherwise I receive an error:
{{{
$ python --version
Python 3.6.9
$ which python
/opt/local/bin/python
$ sudo port select --set pip pip36
Selecting 'pip36' for 'pip' succeeded. 'pip36' is now active.
$ which pip
/opt/local/bin/pip
$ pip --version
Traceback (most recent call last):
File "/opt/local/bin/pip", line 11, in <module>
load_entry_point('pip==19.3.1', 'console_scripts', 'pip')()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
return ep.load()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/site-packages/pkg_resources/__init__.py", line 2449, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'pip._internal'
$ sudo pip --version
pip 19.3.1 from
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/site-packages/pip (python 3.6)
}}}
As you can see `pip` works with `sudo` but not without. I believe at one
time I didn't need to use `sudo` when using `pip` for most common options.
Is there some way to correct this issue? Thank you.
--
Ticket URL: <https://trac.macports.org/ticket/59746>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list