ERROR: virtualenvwrapper could not find virtualenv

2019-03-14 09:15发布

I'm trying to create a virtualenv with virtualenvwrapper, but when I use mkvirtualenv I get the following :

ERROR: virtualenvwrapper could not find virtualenv in your path

I assumed it was a PYTHONPATH problem. But if I do a pip show virtualenv I get the following :

---
Metadata-Version: 2.0
Name: virtualenv
Version: 13.1.0
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Jannis Leidel, Carl Meyer and Brian Rosner
Author-email: python-virtualenv@groups.google.com
License: MIT
Location: /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages
Requires:

And here is my PYTHONPATH :

/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/bin:/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/bin:/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages:/Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages:~/.brew/Cellar

It contains the directory containing virtualenv!

(i-e : /Volumes/Data/nfs/zfs-student-3/users/2013_paris/vmonteco/Library/Python/2.7/lib/python/site-packages )

My ~/.zshrc contains :

export WORKON_HOME=~/Envs
export PROJECT_HOME=$HOME/Devel
source $HOME"/Library/Python/2.7/bin/virtualenvwrapper.sh"

EDIT : virtualenvwrapper.sh is written in bash, perhaps should I check my PATH instead of my PYTHONPATH ?

So, what could the problem be? How could I fix it?

Thank you in advance for your help.

8条回答
Luminary・发光体
2楼-- · 2019-03-14 10:21

Your PYTHONPATH makes me think you have Homebrew installed. It sounds like virtualenvwrapper was installed with either your system pip or your homebrew pip while it is being executed with the opposite python interpreter.

查看更多
该账号已被封号
3楼-- · 2019-03-14 10:21

The way I did it was (using zsh) in this way:

export PATH=$HOME/bin:/usr/local/bin:$PATH:/Users/username/Library/Python/2.7/bin:$PATH

I simply located the file of virtualenvwrapper.sh inside this path /Users/username/Library/Python/2.7/bin:$PATH

and added that path to PATH.

查看更多
登录 后发表回答