I am using Python3.7 and following the virtualenv
and virtualenvwrapper
installation as mentioned on this FreeCodeCamp article.
The changes to my .bashrc
file look as follows:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# popo edit: Add Python alias
alias python=python3
# popo edit: Step to activate virtualenvs
export WORKON_HOME=$HOME/.virtualenvs
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# SOme more things....
#Virtualenvwrapper settings:
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_VIRTUALENV=/home/pra-dan/.local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
On sourcing the .bashrc
, I get
/usr/bin/python3: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 and that PATH is
set properly.
ALthough, I managed to make an environment (idk how) and on typing workon
, I get its name.
But now when I wish to make a new environment, I enter $ mkvirtualenv wrk -p python3
, I get
ERROR: virtualenvwrapper could not find /home/pra-dan/.local/bin/virtualenv in your path