Cannot run virtualenvwrapper on MacOs
Asked Answered
O

1

7

I've tried to run virtualenvwrapper on mac (high sierra 10.13.4) but got this error:

-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory

I have installed with pip following the docs but nothing seems to work :/

And the curious thing is that the file virtualenvwrapper.sh exists in the mentioned directory:

lem4fia@MBP-de-Bruno ~ $ ls /usr/local/bin

enter image description here

I have trid to uninstall and re-install virtualenvwrapper but the same issue still happens.

Anyone got a solution?

Oldfashioned answered 23/9, 2018 at 18:34 Comment(4)
ls -l /usr/local/bin? head -1 /usr/local/bin/virtualenvwrapper.sh? source /usr/local/bin/virtualenvwrapper.sh?Millrace
ls -l /usr/local/bin reveals that virtualenvwrapper.sh points to (?) another path: lrwxr-xr-x 1 lem4fia admin 58 26 Mai 17:50 virtualenvwrapper.sh -> /Users/lem4fia/Library/Python/3.6/bin/virtualenvwrapper.sh if i source this path returns the same error: -bash: /Users/lem4fia/Library/Python/3.6/bin/virtualenvwrapper.sh: No such file or directory the other commands you have mentioned returns the same error tooOldfashioned
Does the file /Users/lem4fia/Library/Python/3.6/bin/virtualenvwrapper.sh exist?Millrace
No, should i move/copy the file to that location or this would be a "mcgyver" trick?Oldfashioned
O
18

Ok i've fixed this issue by doing this:

pip uninstall virtualenvwrapper

the uninstall will ask if i want to proceed, but the first line shows the correct path to virtualenvwrapper.sh since the location changes from OS to OS and version to version, i've copied the path and answered no to keep virtualenvwrapper installed, and then pasted the correct path to .bash_profile.

After this i've got an error saying that virtualenvwrapper could not find the virtualenv, but fixed it by uninstalling and installing again the virtualenv with pip.

Oldfashioned answered 23/9, 2018 at 23:51 Comment(2)
+1 very useful, in my case, I am using pyenv, so the path was /Users/username/.pyenv/versions/3.5.9/bin/virtualenvwrapper.shRomanism
In my case, I installed Python with Homebrew on macOS Monterey and the path (echoed by pip uninstall virtualenvwrapper) was /opt/homebrew/bin/virtualenvwrapper.shDipper

© 2022 - 2024 — McMap. All rights reserved.