I am trying to source project for python3.7

131 views Asked by At

I added this to my .bash_profile

   export WORKON_HOME= sudo $HOME/.virtualenvs
   export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
   source /usr/local/bin/virtualenvwrapper.sh

Then it gives me this message

NOTE: Virtual environments directory /Users/rawad/.virtualenvs does not exist. Creating... mkdir: /Users/rawad/.virtualenvs: Permission denied

What should I do to fix it? I tried a lot of things online, but nothing work.

1

There are 1 answers

1
de1 On

As others pointed out, the code for .bashrc seems to be invalid. Please refer to the official virtualenvwrapper documentation. WORKON_HOME should refer to the base directory you want to store environments in (not a command). e.g.:

export WORKON_HOME=~/virtualenvs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh

Note: I wouldn't recommend using virtualenvwrapper anymore. Just create relative virtual environments and activate them. e.g.:

$cd /path/to/python-project
$python -m venv .venv
$source .venv/bin/activate