问题
Fresh Ubuntu 18.04 install. Following these instructions here are the commands I've run so far.
sudo apt update
sudo apt upgrade
python3 -V
sudo apt install python3-pip
sudo apt install build-essential libssl-dev libffi-dev python3-dev
sudo apt install python3-venv
source /usr/local/bin/virtualenvwrapper.sh
Returns
bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory.
find virtualenvwrapper.sh
Returns
find: ‘virtualenvwrapper.sh’: No such file or directory
EDIT:
Sudo -H pip3 install virtualenv virtualenvwrapper
didn't solve the issue either.
I found this solution that sovled the issue.
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
then make sure to install virtualenv and virtualenvwrapper with:
sudo /usr/local/bin/pip3 install virtualenv virtualenvwrapper
You may have to use sudo's -H flag like I did for it to work.
回答1:
You've installed python3
, pip
and venv
but not virtualenvwrapper
. Install it with pip
:
pip install virtualenvwrapper
回答2:
on Ubuntu 18.04 I had to add this to my .bash_profile
# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenv
export VIRTUALENVWRAPPER_LOG_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_HOOK_DIR="$WORKON_HOME"
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source ~/.local/bin/virtualenvwrapper.sh
Then run source ~/.bash_profile
回答3:
This is what worked for me:
Purge and reinstall pip first.
sudo apt-get purge python-pip
sudo apt-get update
sudo apt-get install python-pip
Then install virtualenvwrapper:
sudo pip install virtualenvwrapper
来源:https://stackoverflow.com/questions/52282037/issue-installing-virtualenvwrapper-on-ubuntu-18-04