I have installed virtualenv and the virtualwrapper via apt-get, I got to a point where I created a virtual enviroment but however later on during that same day when I used the workon command it was not found. I further on went and inspected my home directory and .virtualenvs dir and the virtualenv I created earlier were still there ...any help would be appreciated. Thanks in advance.
Use the workon createdenv command to subsequently activate a virtual environment or just run workon to list all available virtual environments created. You can navigate to other created virtual environments while on a given environment without necessarily deactivating it first. workon createdenv.
virtualenvwrapper is a set of extensions to Ian Bicking's virtualenv tool. The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.
Confirm you're in the virtual environment by checking the location of your Python interpreter, it should point to the env directory. As long as your virtual environment is activated pip will install packages into that specific environment and you'll be able to import and use packages in your Python application.
If you try to run virtualenv and find it isn't present, you can install it using pip. virtualenv.exe will likely now be found in your python installation directory under the Scripts subdirectory.
Solving this problem took two steps:
Add this to your .bashrc
/ .bash_profile
/ .zshrc
:
# load virtualenvwrapper for python (after custom PATHs) venvwrap="virtualenvwrapper.sh" /usr/bin/which -s $venvwrap if [ $? -eq 0 ]; then venvwrap=`/usr/bin/which $venvwrap` source $venvwrap fi
Then use:
source .bash_profile # or .bashrc / .zshrc
to reflect the changes.
Additionally, if the terminal still sometimes cant find workon
, use source .bash_profile
to reset and find it again.
type source .profile
in home directory from terminal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With