python3.4在我的mac上下载到哪里了?

时间:2014-09-11 19:05:15

标签: python terminal virtualenv

我今天决定最好下载python 3.4。所以我去python / downloads页面做那个。现在我正在尝试使用我的新python模块mkvirtualenv -p python3.4 sandbox创建一个新的virtualenv,但是我得到一个错误,它无法找到我的python可执行文件。

The executable /Users/croberts/python3.4 (from --python=/Users/croberts/python3.4) does not exist

这是可以理解的,但我无法弄清楚它在哪里。旧版本的python位于/ usr / bin /中,但新版本没有安装在那里。你如何搜索程序使用终端的位置?

1 个答案:

答案 0 :(得分:0)

根据与安装程序捆绑的ReadMe.txt,Python安装默认为/Library/frameworks/Python.framework。我刚做了一个测试安装,它最终在这里结束:

/Library/frameworks/Python.framework/versions/3.4/Python

除非您更改了安装程序的设置,否则它应该存在。 (如果你是从源代码安装的,我会假设你知道你把它放在哪里。)需要注意的是,如果你使用Homebrew(可能还有其他OSX软件包管理器,比如MacPorts,虽然我还没有使用它),通过PPC安装程序安装Python将引发警告:

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

因此,如果您使用Homebrew(并且很棒),最好只使用brew install python3,这会将其放入/usr/local/bin。然后,您可以将python(或python3)别名替换为该版本。