I\'m trying to follow How To Serve Django Applications with uWSGI and Nginx on Ubuntu 14.04 and I\'m failing at the very earlier stage, due to amount of output, I placed all
On my computer, I ran sudo apt install python-pip
and then pip install virtualenvwrapper
but on my settings, I set it as follows:
export WORKON_HOME=$HOME/.Envs
export VIRTUALENVWRAPPER_PYTHON=$(which -a python3)
source $HOME/.local/bin/virtualenvwrapper.sh
That got rid of the error and note that I am using python3 and I use pip3 as my default
I faced similar problem, when using python3 with virtualenvwrapper,
sudo apt-get install python3-pip
Then install virtualenv and virtualenvwrapper from pip3,
sudo pip3 install virtualenv virtualenvwrapper
then source it again,
source $HOME/.bashrc
Thanks to @Alexander, I was able to fix my issue by changing the line in ~/.bashrc
:
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
to
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
due to backwards compatibility.
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
good choice, but you already knew /usr/bin/python is 2.7
If you want to use version 3
sudo apt-get install python3-pip
and logout & login
check your python3
installation directory:
which python3
If installed by brew you should get:
/usr/local/python3
export python version to be used virtualenvwrapper:
export VIRTUALENVWRAPPER_PYTHON=/usr/local/python3
source your shell configuration file:
bash
source .bashrc
zsh
source .zshrc
I've got this error for entirely different reasons, but since I ended up on this thread, I gather somebody might find this useful. So in my case, it turned out that my script was attempting to activate the virtual environment while I was already on it (the workon
statement is issued from my .profile
file). And so the solution was to simply deactivate
the environment first and then run the script.