没有名为virtualenvwrapper的模块;的virtualenv

时间:2016-06-20 17:22:47

标签: python pip virtualenv virtualenvwrapper

我已经使用virtualenvwrapper几个月了,今天我从源代码安装了python2.6来使用tox。

突然间我得到了:

$ cdwebapi 
/usr/local/bin/python: No module named virtualenvwrapper
/usr/local/bin/python: No module named virtualenvwrapper
/usr/local/bin/python: No module named virtualenvwrapper
/usr/local/bin/python: No module named virtualenvwrapper

安装了包装器:

$ sudo pip install virtualenvwrapper
The directory '/home/cchilders/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/cchilders/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied (use --upgrade to upgrade): virtualenvwrapper in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): stevedore in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv-clone in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages (from virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): pbr>=1.6 in /usr/local/lib/python2.7/dist-packages (from stevedore->virtualenvwrapper)
Requirement already satisfied (use --upgrade to upgrade): six>=1.9.0 in /home/cchilders/.local/lib/python2.7/site-packages (from stevedore->virtualenvwrapper)

如果我再次尝试采购:

$ src

/usr/local/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/local/bin/python and that PATH is
set properly.
--no-deps: command not found

这就是我的来源:

# VIRTUALENVWRAPPER
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/work_projects
source /usr/local/bin/virtualenvwrapper.sh
export PATH=$PATH:/usr/local/bin/virtualenvwrapper.sh

我的静脉仍然存在:

$ which python
/home/cchilders/.virtualenvs/mysite/bin/python

(mysite) cchilders:~/work_projects/core/unver/mysite (master) 
$ which pip
/home/cchilders/.virtualenvs/mysite/bin/pip

将bashrc更改为:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/work_projects
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
export PATH=$PATH:/usr/local/bin/virtualenvwrapper.sh

导致:

$ cdwebapi 
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')
/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (<class 'ImportError'>: No module named 'virtualenvwrapper')

我刚删除并重新安装了virtualenvwrapper和同样的问题。如何平息这些消息并修复包装器?谢谢

0 个答案:

没有答案