python - 尝试使用 pip3 安装 virtualenvwrapper

标签 python linux ubuntu virtualenv virtualenvwrapper

我正在使用 Ubuntu 14.4 LTS 实例在 ec2 上设置一个 django 项目。我想使用 python 3 和 django 编写我的代码。我被告知最好的方法是使用 virtualenvwrapper。我试过:

ubuntu:~$ sudo pip3 install virtualenvwrapper   

      Successfully uninstalled six
Successfully installed virtualenvwrapper virtualenv virtualenv-clone stevedore argparse pbr six
Cleaning up...
ubuntu:~$ mkvirtualenv env1
mkvirtualenv: command not found

我做错了什么?

编辑:

我按照您的指示,注销并重新登录:

/usr/bin/python: No module named virtualenvwrapper
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/bin/python and that PATH is
set properly.

我怀疑这是因为我正在安装到 python3,它不是默认的 python 解释器

最佳答案

From the documentation

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

特别是,采购上面的 shell 脚本将允许您运行所有 virtualenvwrapper 命令。

关于python - 尝试使用 pip3 安装 virtualenvwrapper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28772740/

相关文章:

ubuntu - 在 Ubuntu 13.10 中重新映射 Ctrl、Alt 和 Super 键

python - 已结束的程序(Flask)一直将输出发送到 STDOUT?

python - 为进程指定特定的CPU - python multiprocessing

linux - 获取不在 file2 中的 file1 行

regex - grep -E 具有多个元字符

linux - Linux系统调用层如何跟踪文件的属性变化

python - for y in range(y) 在 Python 中

python - 带有十六进制输入的 Python 中的 CRC32 校验和

android - ubuntu终端中的错误命令

c - 通过网络 Ubuntu 和 C 发送声音