Yunti
Yunti

Reputation: 7428

python virtualenvwrapper bad interpreter

I recently upgrade from python 3.5 to python 3.6 (with brew on macOS). However virtualenvwrapper now seems to be broken and I get the error. A reinstall didn't help unfortunately.

mkvirtualenv:78: /usr/local/bin/virtualenv: bad interpreter: /usr/local/opt/python3/bin/python3.5: no such file or directory

I have VIRTUALENV_PYTHON=python3 set so the default is to install a virtualenv with python3.

Upvotes: 13

Views: 8611

Answers (3)

Isisco
Isisco

Reputation: 141

Use: pip install --upgrade virtualenv

OR: sudo pip install -U --force-reinstall virtualenv

Upvotes: 0

Clement
Clement

Reputation: 4811

For me, it was because there were spaces in some of the directory names and virtualenv did not parse the path correctly. To be safe, just remove spaces from the directory names and replace them with - or _ and it should work fine :)

Upvotes: 0

user8731255
user8731255

Reputation: 426

  1. open the terminal use which python3.6 to show the path of python3.6
  2. open the file /usr/local/bin/virtualenv
  3. change the first line which starts with #! with the path of python3.6 before

Upvotes: 41

Related Questions