0

I'm having trouble installing packages using virtualenv with python. I do the following:

sudo virtualenv venv
cd venv/bin
source activate
pip install nose

I get the following error:

unable to execute /Users/../venv/bin/pip: No such file or directory

What am I doing wrong here?

KexAri
  • 3,867
  • 6
  • 40
  • 80
  • 1
    Why do you create your virtualenv with sudo? That might be what's causing the problem. root owns the virtualenv and you try to install stuff in it as your regular user. – simon Mar 07 '17 at 15:30
  • @gurka tired just now without the sudo and seeing the same error – KexAri Mar 07 '17 at 15:36
  • 1
    What's your OS and what version of python are you running? – oxtay Mar 07 '17 at 16:48
  • Sierra, python 2.7 – KexAri Mar 07 '17 at 16:52
  • If you didn't erase the virtualenv that you created with sudo, you're going to have problems using it without sudo as well. Never use sudo with virtualenv. Try `sudo rm -rf ` and start over without sudo. – Jim Stewart Mar 07 '17 at 19:06

1 Answers1

0

run:

cd /usr/local/bin
sudo ./pip install virtualenv
which virtualenv 

This should point to /usr/local/bin/virtualenv

which pip

This should point to /usr/local/bin/pip

virtualenv /Users/yourname/path/to/env/envname
oshaiken
  • 2,593
  • 1
  • 15
  • 25