4

I have installed virtualenv using pip command:

$ pip install --user virtualenv

and virtualenwrapper

$ pip install --user virtualenvwrapper

everything worked fine:

$ pip show virtualenvwrapper
Name: virtualenvwrapper
Version: 4.3.2
Location: /home/mukesh/.local/lib/python2.7/site-packages
Requires: virtualenv, virtualenv-clone, stevedore

I made two directories ".virtenvs" and "Project-Active". I am doing this by following a blog post. Then I have changed my .bashrc file by adding following lines:

export WORKON_HOME=$HOME/.virtenvs
export PROJECT_HOME=$HOME/Projects-Active
source $HOME/.local/bin/virtualenvwrapper.sh

After saving the changes, I sourced the file to make the changes active:

$ source ~/.bashrc

When I am trying to make a new virtual environment by using following command:

$ mkvirtualenv test_env01

I am getting error:

ERROR: virtualenvwrapper could not find virtualenv in your path

Don't know what should I do now.

4

I tried to follow the tutorial as well, but it still fails, then had to do it another way:

# pip install virtualenv
# pip install virtualenvwrapper

After doing so, which command worked indicating where the executable is:

which virtualenvwrapper.sh
/usr/local/bin/virtualenvwrapper.sh

As I understand it in a publication, the virtualenv must be installed via sudo without the --user option.

3

I could solve the problem by installing virtualenv via apt-get

sudo apt-get install virtualenv

I really don't know the consequences of this, but so far it works for me

3

DO the two steps:

1) sudo find / -name "virtualenv"

Then I find the executable file, the path is:

/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv

2) Touch a soft link in the or add the path to the .bash_profile, I prefer the former:

sudo ln -s /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/bin/virtualenv /usr/local/bin/virtualenv
2

From my experience, following the instructions on some sites will land you in problem. Here's how i did it but first the common mistakes:

pip install virtualenv
pip install virtualenvwrapper
export WORKON_HOME=~/Envs
source /usr/local/bin/virtualenvwrapper.sh

now that's not gonna work for you especially now with 16.04 comes with virtualenv as one of her packages. Some pitfalls is now trying to uninstall it with:

sudo pip uninstall virtualenv

when you never installed it with admin rights. Instead do:

pip uninstall virtualenv

then now install it with the Ubuntu repo (recommended) using:

sudo apt-get install virtualenv
sudo apt install virtualenvwrapper

virtualwrapper (user friendly wrappers for the functionality of virtualenv) The reason we are also installing virtualwrapper is because it offers nice and simple commands to manage your virtual environments.

echo "source /usr/share/virtualenvwrapper/virtualenvwrapper.sh" >> ~/.bashrc

Source virtualenvwrapper in .bashrc

or

open your .bashrc file and add:

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/PyProj
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh

this will set the location where the virtual environments should live, the location of your development project directories, and the location of the script installed with this package.

now run workon if this is your first time it won't show anything, don't panic. If not, a list of environments, empty, is printed. run mkvirtualenv temp new environment, temp is created and activated. then run workon again This time, the temp environment is included.

Now have fun

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.