Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to use mkvirtualenv . to create a virtualenv in the current directory, but with no success:

~/repos/foo$ mkvirtualenv .
created virtual environment CPython3.9.5.final.0-64 in 284ms
  creator CPython3Posix(dest=/Users/mdval/.virtualenvs, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/mdval/Library/Application Support/virtualenv)
    added seed packages: pip==21.2.3, setuptools==57.4.0, wheel==0.37.0
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator
ERROR: Environment 'foo' does not exist. Create it with 'mkvirtualenv foo'.

However, using mkvirtualenv foo works. Can someone help me, please?

Here's my .zshrc config:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/repos
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
source /usr/local/bin/virtualenvwrapper.sh
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
216 views
Welcome To Ask or Share your Answers For Others

1 Answer

virtualenvwrapper is intended to manage all you virtual environments. To do that it stores all virtual envs in one place — under $WORKON_HOME. That is, mkvirtualenv foo creates a virtual env in $HOME/.virtualenvs/foo/.

If you want to create a virtual env in a different directory that means you want to create a virtual env that is not under control of virtualenvwrapper. Sure, no problem, just create a virtual env using virtualenv:

virtualenv .

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...