$ sudo easy_install pip ( on mac high sierra)
Traceback (most recent call last):
File "/usr/bin/easy_install-2.7", line 11, in <module>
load_entry_point('setuptools==18.5', 'console_scripts', 'easy_install')()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2707, in load_entry_point
return ep.load()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2325, in load
return self.resolve()
File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2331, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 46, in <module>
from setuptools.archive_util import unpack_archive
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/archive_util.py", line 15, in <module>
from pkg_resources import ensure_directory, ContextualZipFile
ImportError: cannot import name ContextualZipFile
$ which python
/usr/bin/python
$ which pip
/usr/local/bin/pip
$ which python3
/usr/local/bin/python3
答案 0 :(得分:3)
您应该首先尝试使用以下命令安装pip:
...
WHERE CASE _cond WHEN '>' THEN id > _id
WHEN '<' THEN id > _id
WHEN '!=' THEN id != _id
...
WHEN '<>' THEN id <> _id
END,
...
如果要为python2安装它:
sudo apt update
sudo apt install python3-pip
然后您可以使用以下方法验证版本:
sudo apt update
sudo apt install python-pip
希望这会有所帮助。
答案 1 :(得分:0)
在这里,您的Mac上安装了两个版本的python。
首先是Python 2.x(默认设置)和Python3.x。
这是我早些时候也遇到过的一个问题,所以我建议是这个
$sudo apt install python3-pip
这将显式安装适用于Python 3.x的pip
完成后,使用虚拟环境。