virtualenvwrapper初始化错误(

时间:2018-03-18 12:11:26

标签: python-3.x homebrew virtualenvwrapper

我正在尝试使用virtualenvwrapper为我的Django项目设置virtualenv,遵循本指南:Django Tutorial。 但是,安装和写入后,

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

并尝试运行source~ / .bash_profile,我一直没有得到目录错误。我研究了这个错误,并认为错误不断出现,因为我用自制软件安装了python3。

因此,我将VIRTUALENVWRAPPER_PYTHON目录更改为/usr/local/Cellar/python/3.6.4_4 virtualenvwrapper.sh。

但现在我收到了这个错误:

virtualenvwrapper_run_hook:12: permission denied: /usr/local/Cellar/python/3.6.4_4
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/Cellar/python/3.6.4_4 and that PATH is
set properly.

如何重置PATH以便我可以使用virtualenvwrapper?

1 个答案:

答案 0 :(得分:0)

你可以尝试一下,把它添加到你的.bashrc中,它适用于我

导出WORKON_HOME = $ HOME / .virtualenvs

export VIRTUALENVWRAPPER_PYTHON = / usr / bin / python3

export VIRTUALENVWRAPPER_VIRTUALENV = / usr / local / bin / virtualenv

来源/usr/local/bin/virtualenvwrapper.sh