2024-05-14 03:48:22 发布
网友
我已经安装了virtualenv和virtualenvwrapper,但在尝试设置应用程序时,输入mkvirtualenv --no-site-packages会得到以下错误:
mkvirtualenv --no-site-packages
-bash: mkvirtualenv: command not found
我不知道如何解决这个问题。作为一个初学者,我很感激你的帮助。
您需要启用virtualenvwrapper,如its docs中所述。
virtualenvwrapper
Shell Startup FileAdd 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:
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:
.bashrc
.profile
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).
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
您需要启用
virtualenvwrapper
,如its docs中所述。这实际上可能有一点不同,这取决于你如何安装它。如果你用apt在Ubuntu上安装它,virtualenvwrapper函数实际上会被滚动到bash完成文件中(弄清楚这很有趣!)。
相关问题 更多 >
编程相关推荐