Virtualenv - workon command not found

后端 未结 2 1418
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 09:07

I followed these steps to set up virtualenv + virtualenvwrapper:

$ sudo apt-get install python3-pip

$ sudo pip3 install virtualenv
$ sudo pip3 install virtu         


        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-14 10:02

    So far it was working fine but I restarted the shell

    The reason is because you restarted the shell.

    If you want this to work with each shell, you'll need to add these to your ~/.bashrc file:

    export WORKON_HOME=~/.virtualenvs
    VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3'
    source /usr/local/bin/virtualenvwrapper.sh
    

    After adding this, you'll want to source ~/.bashrc so the changes take effect. You'll find that you have access to virtualenvwrapper facilities in each new shell.

提交回复
热议问题