【问题标题】:Where did python3.4 download to on my mac?python3.4在我的mac上下载到哪里?
【发布时间】:2014-09-11 19:05:14
【问题描述】:

我今天决定我最好下载 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/ 中,但新版本没有安装在那里。如何搜索程序在哪里使用终端?

【问题讨论】:

  • OSX 是否内置了which?在 Linux 上,我只会使用 which python3.4
  • which 确实存在于 OSX 上。通常它会在某个地方,例如 /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4

标签: python terminal virtualenv


【解决方案1】:

根据安装程序捆绑的 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)别名为该版本。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 2020-07-30
    • 1970-01-01
    • 1970-01-01
    • 2015-09-19
    相关资源
    最近更新 更多