7

After a lot of struggle with virtualenv/virtualenvwrapper I decided to remove all virtualenvs and re-install the packages.

root> su myuser
myuser> sudo pip install virtualenv
myuser> sudo pip install virtualenvwrapper

I proceeded to add this to my unix users .bashrc file.

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7
source /usr/local/bin/virtualenvwrapper.sh

When I source .bashrc I get about 20 error lines ending with IOError: [Errno 13] Permission denied: '/root/.virtualenvs/premkproject'. I'm running out of ideas...

I have done my homework and tried every suggested solution I could find. I'm running Ubuntu 12.04.

1 Answers1

1
sudo pip install virtualenv

The sudo means you're installing virtualenv with root. You need to install virtualenv to the user profile instead with just:

pip install virtualenv
muru
  • 193,181
  • 53
  • 473
  • 722
Morifen
  • 31
  • 3
  • That's the exact opposite of what the answers [here](https://stackoverflow.com/q/24504231/2745116) suggest... – stefanbschneider Sep 27 '18 at 12:59
  • 1) That thread is specifically for dealing with system level packages 2) That thread comes with the warning: running pip as sudo can dangerously affect your OS files. You run major risks of harming your system, and there are ways to set up your machine so that you don't need to use sudo. 3) This user specifically uses `su myuser` to avoid being root, then uses `sudo` which undoes that. – Morifen Oct 03 '18 at 19:44