我的virtualenv和virtualenvwrapper安装,而是试图建立一个应用程序时,我进入mkvirtualenv --no-site-packages
我得到以下错误:mkvirtualenv --no-站点包命令得到“未找到命令”错误
-bash: mkvirtualenv: command not found
我不知道如何解决这个问题。作为初学者,我会很感激任何帮助。
我的virtualenv和virtualenvwrapper安装,而是试图建立一个应用程序时,我进入mkvirtualenv --no-site-packages
我得到以下错误:mkvirtualenv --no-站点包命令得到“未找到命令”错误
-bash: mkvirtualenv: command not found
我不知道如何解决这个问题。作为初学者,我会很感激任何帮助。
您需要启用virtualenvwrapper
,如its docs中所述。
Shell Startup File
Add three lines to your shell startup file (
.bashrc
,.profile
, etc.) to set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package:
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh
After editing it, reload the startup file (e.g., run
source ~/.bashrc
).
取决于你如何安装呢?这实际上可以改变一点点。如果你使用apt将它安装在Ubuntu上,那么virtualenvwrapper函数实际上会被放入一个bash完成文件(找出它很有趣!)。
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
possible_scripts='/usr/local/bin/virtualenvwrapper.sh /etc/bash_completion.d/virtualenvwrapper'
for script in $possible_scripts; do
[[ -f $script ]] && source $script
done