如何在OS X Yosemite 10.10.5上设置$ PYTHONPATH?

时间:2019-01-11 18:05:13

标签: bash terminal osx-yosemite pythonpath

我正在使用terminal外壳的-bash

ps -p$$ -ocommand=    --->    -bash

echo $ PATH返回:

-bash: /usr/local/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/alex_fimm_dev/Desktop/Databases/Mongo/mongodb/bin:/Users/alex_fimm_dev/Desktop/Databases/Mongo/mongodb/bin:/usr/local/Cellar/android-sdk/24.4.1_1/tools:/usr/local/Cellar/android-sdk/24.4.1_1/platform-tools

echo $ PYTHONPATH ----->不返回任何内容

需要将$ PYTHONPATH设置为/ directory / of / choice

我尝试失败,

export PYTHONPATH=$PATH:/directory/of/choice

还写信给:nano .bash_profile:

export PYTHONPATH=$(/directory/of/choice)

我还关闭了它们之间的终端以检查更改。

1 个答案:

答案 0 :(得分:0)

以下所有文件的导出路径:

private/etc/profile

喜欢:

export PYTHONPATH="/directory/of/choice"

帮了我大忙。如以下所述:

PYTHONPATH in OS X