[英]pip install not working, Distribution not found
I am trying to install Pip and anaconda.我正在尝试安装 Pip 和 anaconda。
In my mac I have both python 2 as well as python 3.在我的 mac 中,我有 python 2 和 python 3。
When I try to easy_install pip
I get the error [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-14341.write-test'
当我尝试
easy_install pip
我收到错误[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-14341.write-test'
So I tried to do a pip install
所以我试着做一个
pip install
I GOT我有
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module>
@_call_aside
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside
f(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master
return cls._build_from_requirements(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.3.1' distribution was not found and is required by the application
Also I cannot install Anaconda, maybe because of this problem我也无法安装 Anaconda,可能是因为这个问题
PS.附注。 I have used homebrew to install python.
我已经使用自制软件来安装python。
Have anyone solved it?有人解决了吗?
One of the problem is that from now on we to use pip3
instead of just pip
.问题之一是,从现在开始,我们将使用
pip3
而不是pip
。 Another problem is that the open ~/.zshrc
file need to be updated with the same open ~/.bash_profile
instruction from anaconda.另一个问题是
open ~/.zshrc
文件需要使用来自 anaconda 的相同的open ~/.bash_profile
指令进行更新。
IN CONCLUSION综上所述
I think that for installing pip packages you need to use the pip3
command or you could write an alias file where you substitute pip with pip3.我认为要安装 pip 包,您需要使用
pip3
命令,或者您可以编写一个别名文件,将 pip 替换为 pip3。
Then for actually using conda
I followed this article so that it overrun the zhs of the mac config.然后为了实际使用
conda
我遵循了这篇文章,以便它超出 mac 配置的 zhs。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.