关于“brew link numpy”的问题'

时间:2018-05-09 20:40:47

标签: python macos numpy homebrew

亲爱的Stackoverflow社区,

我对brew link numpy有疑问。我安装了最新的python,但它仍然使用python 2.7。有了下面显示的错误日志,我做了什么,我仍然坚持到这里。此外,我在使用Mac上的当前python环境安装opencv功能时遇到问题。

Error: Could not symlink lib/python2.7/site-packages/numpy/LICENSE.txt
Target /usr/local/lib/python2.7/site-packages/numpy/LICENSE.txt
already exists. You may want to remove it:
rm '/usr/local/lib/python2.7/site-packages/numpy/LICENSE.txt'

To force the link and overwrite all conflicting files:
brew link --overwrite numpy

To list all files that would be deleted:
  brew link --overwrite --dry-run numpy

1 个答案:

答案 0 :(得分:0)

如果你有2个不同版本的python,你应该为每种python创建一个虚拟环境。

如果使用Anaconda安装了python 3.6,请搜索Anaconda文档以创建虚拟环境。

如果以另一种方式安装python 3.6,则可以使用unix命令创建虚拟环境。

您可以为python 2.7创建一个环境,为python 3.6创建另一个环境。激活您要运行的任何版本。