6
$ echo $PATH
/usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

所以 /usr/local/bin 在我的路径中。

当我做“哪个python3”时

/usr/local/bin/python3

然后当我尝试创建一个 virtualenv

mkvirtualenv py3000 --python=python3

The executable /Users/misdirectedpuffin/python3 (from --python=/Users/misdirectedpuffin/python3) does not exist

Virtualenv 在使用默认 python 时有效,即mkvirtualenv testenv' and when doing 'mkvirtualenv py3000 --python=/usr/local/bin/python3

它似乎在 $HOME 中寻找 python3。我该如何纠正?

** 编辑 **

我也可以设置export python3=/usr/local/bin/python3bash_profile然后$python3用调用--python=$python3,但我真正想要的是--python=python3没有美元符号。

4

1 回答 1

0

完成后brew doctor,我被告知以下内容:

Warning: /usr/local/share/python is not needed in PATH.
Formerly homebrew put Python scripts you installed via `pip` or `pip3`
(or `easy_install`) into that directory above but now it can be removed
from your PATH variable.
Python scripts will now install into /usr/local/bin.
You can delete anything, except 'Extras', from the /usr/local/share/python
(and /usr/local/share/python3) dir and install affected Python packages
anew with `pip install --upgrade`.

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

进行这些更改后,我能够mkvirtualenv py3000 -p python3

于 2013-11-13T18:27:56.870 回答