Saltar al contenido

~ / archivo / stackoverflow / 12647266

Where is virtualenvwrapper.sh after pip install?

StackOverflow · python, macos, virtualenv, pip, virtualenvwrapper · ayudé
  1. zakdances pregunta +160 2012-09-28 20:54

    I'm trying to setup virtualenvwrapper on OSX, and all the instructions and tutorials I've found tell me to add a source command to .profile, pointing towards virtualenvwrapper.sh. I've checked all the python and site-packages directories, and I can't find any virtualenvwrapper.sh. Is this something I need to download separately? Is pip not installing correctly?

    This is the contents of /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenvwrapper:

    hook_loader.py      hook_loader.pyc     project.py      project.pyc     user_scripts.py     user_scripts.pyc
    

    As you can see, no virtualenvwrapper.sh. Where is it?

    • Hartley Brody 2021-12-02 23:14 For me, since I used pyenv global 3.9.1 to set my default system python before running pip install virtualenvwrapper, the file ended up getting installed at ~/.pyenv/versions/3.9.1/bin/virtualenvwrapper.sh. Hope that helps anyone else using pyenv!
  2. dm03514 respuesta aceptada +189 2012-09-28 22:11

    You can use the find command to search for a file:

    find / -name virtualenvwrapper.sh

    This will search all directories from the root for the file.


    on ubuntu 12.04 LTS, installing through pip, it is installed to

    /usr/local/bin/virtualenvwrapper.sh


    on ubuntu 17.04, installing through pip as a normal user, it is installed to

    ~/.local/bin/virtualenvwrapper.sh

    • robertspierre 2020-12-15 20:46 On Ubuntu 20.10, it is also installed in ~/.local/bin/virtualenvwrapper.sh
    • Karan Singh 2021-02-09 01:10 On Ubuntu 16.04, it is installed in ~/.local/bin/virtualenvwrapper.sh
  3. hepidad respuesta +107 2013-05-23 04:42

    did you already try this ?

    $ which virtualenvwrapper.sh
    
    • zakdances 2013-05-23 04:49 this works, but why doesn't which virtualenvwrapper work? Isn't that the name of the command in the environmental variables?
    • Tim 2013-07-29 19:24 To help anybody else asking this same question about why which doesn't work, it's because virtualenvwrapper is actually using its custom bash completion file to add purely virtual commands, of which the common virtualenvwrapper command is one. Consequently, there is no physical file on the drive for which to point to.
    • tenfishsticks 2015-05-15 15:09 @yourfriendzak, the bash script virtualenvwrapper.sh needs to be sourced in your shell before any of the commands (mkvirtualenv, rmvirtualenv, etc.) are available, i.e. $ source /path/to/virtualenvwrapper.sh
    • danagerous 2018-02-14 05:17 This was much faster than find but both worked. Mine was located in usr/local/bin on OS X.
  4. Anuj Gupta respuesta +76 2017-01-16 12:43

    The exact path where virtualenvwrapper.sh is stored/located varies from OS to OS. Even with in same OS, it varies from version to version. So we need a generic solution that works for all OS versions.

    Easiest way I have found to find its path is: Do

    pip uninstall virtualenvwrapper
    

    This will prompt a confirmation. Say "No" But first line of confirmation shows the path of virtualenvwrapper.sh (Prompt gives a list of files it will delete, if you say Yes. First entry in this list contains path to virtualenvwrapper.sh in your machine)

    • whyisyoung 2018-03-20 17:32 It didn't work for me. I'm using Python 2.7.14 with Virtualenv 15.1.0 , virtualenvwrapper 4.8.2.
    • Anuj Gupta 2018-03-21 10:55 @whyisyoung : seriously? can you send me the screen shot right after you run "pip uninstall virtualenvwrapper"
    • Mahesh Vemula 2019-03-10 13:20 Nice shortcut. I am using this even for other libraries. Thank!
  5. user2625596 respuesta +58 2013-07-27 12:46

    I just reinstalled it with pip.

    sudo pip uninstall virtualenvwrapper
    sudo pip install virtualenvwrapper
    

    And this time it put it in /usr/local/bin.

    • eddiemoya 2015-07-02 17:07 This worked for me on Ubuntu, also allowing which virtualenvwrapper.sh to work, which had been returning nothing until I did this.
    • tomaskazemekas 2016-03-24 12:25 After this command on Fedora 23 I have found virtualenvwrapper.sh only in usr/bin .
    • Hauke 2016-06-06 15:10 Had initially installed it with apt-get and it landed in /usr/share/virtualenvwrapper/virtualenvwrapper.sh, then purged it and did your trick.
    • Alan 2019-02-06 19:15 This worked for me in Ubuntu 14.04 if you find / -name xxxx.sh didn't find anything.
  6. iMitwe respuesta +15 2013-03-28 09:32

    or, like I did..just uninstall virtualenvwrapper

    sudo pip uninstall virtualenvwrapper

    and then install it with easy_install

    sudo easy_install virtualenvwrapper

    this time I found the file "/usr/local/bin/virtualenvwrapper.sh" installed... Before that I weren't finding that file anywhere even by this command

    find / -name virtualenvwrapper.sh

  7. Tianqi Tong respuesta +12 2015-11-07 07:19

    On Mac OS

    which virtualenvwrapper.sh
    

    u got

    /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh
    

    and u can

    sudo ln /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh
    

    and in your .bash_profile

    source /usr/local/bin/virtualenvwrapper.sh
    

    or u can

    source /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh
    
  8. Shawn Zhang respuesta +9 2016-01-10 06:17

    In OSx EI captain, I installed the virtualenvwrapper as

    sudo pip3 install virtualenvwrapper
    

    , however I cannot find the virtualenvwrapper.sh in /user/local/bin, it was finally found at /Library/Frameworks/Python.framework/Versions/3.4/bin/virtualenvwrapper.sh , and you can make an soft link to /usr/local/bin as

    ln -s /Library/Frameworks/Python.framework/Versions/3.4/bin/virtualenvwrapper.sh /usr/local/bin/virtualenvwrapper.sh, and everything you can just follow the setup guide as the official document does. Good luck!

  9. JohnyMoSwag respuesta +7 2013-02-22 23:20

    In OS X 10.8.2, with Python 2.7:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh

  10. vmonteco respuesta +5 2015-07-07 15:03

    For me it was in :

    ~/Library/Python/2.7/bin/virtualenvwrapper.sh
    

    (With OS X, with a pip install --user installation)

  11. haijin respuesta +4 2012-11-30 16:57

    I have the same problem. If you have older version of virtualenvwrapper, then pip wont work.

    download src from http://pypi.python.org/pypi/virtualenvwrapper/3.6 and python setup.py install. Then the problem solved.

  12. Diego Geovani respuesta +4 2013-09-28 14:22

    For RPM-based distributions(like Fedora 19), after running the sudo pip install virtualenvwrapper command, you may find the file at:

    /usr/bin/virtualenvwrapper.sh
    
    • Reuel Ribeiro 2020-04-28 17:42 On Manjaro, arch based, it was also located under /usr/bin instead of /usr/local/bin. I don't know why.
  13. yemy respuesta +4 2022-10-28 18:25

    If you use brew on Mac you can find it at

    /opt/homebrew/bin/virtualenvwrapper.sh

  14. tayfun respuesta +3 2015-11-16 20:35

    Installed it using pip on Ubuntu 15.10 using a normal user, it was put in ~/.local/bin/virtualenvwrapper.sh which I found by running:

    $ find / -name virtualenvwrapper.sh 2>/dev/null

  15. Lora Holmes respuesta +3 2016-08-27 10:41
    /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    

    I've installed it on Ubuntu 16.04 and it resulted in this location.

    • Siladittya 2017-12-07 19:50 This happened for me too. :(
    • MiGu3X 2020-09-28 16:43 Same for ubuntu 20.04
  16. Aviendha respuesta +2 2013-10-28 02:25

    Using

    find / -name virtualenvwrapper.sh
    

    I got a TON of "permissions denied"s, and exactly one printout of the file location. I missed it until I found that file location when I uninstall/installed it again with pip.

    In case you were curious, it was in

    /usr/local/share/python/virtualenvwrapper.sh
    
    • psycat 2015-03-21 13:50 to get rid of 'permission denied' you can redirect STDERR to /dev/null. For example: $ find / -name virtualenvwrapper.sh 2>/dev/null
  17. Idan Magled respuesta +2 2016-06-25 10:51

    In my case (OSX El Capitan, version 10.11.5) I needed to edit the .profile like so:

    In the terminal:

    vim ~/.profile

    export WORKON_HOME=$HOME/.virtualenvs
    export MSYS_HOME=C:\msys\1.0
    source /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenvwrapper.sh                                                                                   
    

    And then reload the profile (that it will be availuble in the current session.)

    source ~/.profile

    Hope it will help someone.

  18. svetkesh respuesta +2 2019-05-14 11:39

    I can find one in macOS Mojave (10.14) while playing with virtualenvwrapper-4.8.4

    /Library/Frameworks/Python.framework/Versions/3.7/bin/virtualenvwrapper.sh

  19. jkdev respuesta +1 2016-08-10 04:05

    Although this is an OS X question, here's what worked for me on Linux (Red Hat).

    My virtualwrapper.sh was in

    ~/.local/bin/virtualenvwrapper.sh
    

    This is probably because I installed virtualenvwrapper locally, using the --user flag...

    pip install --user virtualenvwrapper
    

    ...as an alternative to the risky practice of using sudo pip.

  20. user650654 respuesta 2012-09-28 20:59
    /usr/local/bin/virtualenvwrapper.sh
    
    • zakdances 2012-09-28 21:02 No such file or directory I also browsed the /usr/local/bin directory and couldn't find anything that looked related to virtualenv or virtualenvwrapper
  21. Sudeep respuesta 2015-07-17 10:29

    I had the same issue in with the beagle bone black(debian).

    Manually downloading the package and installing worked for me.

  22. Abhinav Tripathi respuesta 2016-03-27 13:32

    For Ubuntu
    If you just installed it, check the output on Terminal, I'm posting mine :

    Running setup.py install for virtualenv-clone    
    Installing virtualenv-clone script to /home/username/.local/bin
    Successfully installed virtualenvwrapper virtualenv virtualenv-clone stevedore pbr six
    Cleaning up...
    

    Here the second line tells you the path. For me it was at /home/username/.local/bin

  23. naveen.panwar respuesta 2016-05-27 16:10

    pip will not try to make things difficult for you on purpose.

    The thing is commands based files are always installed in /bin folders they can be anywhere on the system path.

    I had the same problem and I found that I have these files in my

    ~/.local/bin/

    folder instead of

    /usr/loca/bin/

    which is the common case, but I think they changed the default path to

    ~ or $HOME

    directory because its more isolate for the pip installations and provides a distinction between apt-get packages and pip packages.

    So coming to the point you have two choices here either you go to your .bashrc and make changes like this

    # for virtualenv wrapper
    export WORKON_HOME=$HOME/Envs
    export PROJECT_HOME=$HOME/Devel
    source $HOME/.local/bin/virtualenvwrapper.sh
    

    and than create a directory virtualenvwrapper under /usr/share/ and than symlink your virtualwrapper_lazy.sh like this

    sudo ln -s ~/.local/bin/virtualenvwrapper_lazy.sh /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
    

    and you can check if your workon command is working which will list your existing virtualenv's.

  24. Miguel Ortiz yo respuesta 2018-09-05 19:09

    If you execute pip install virtualenvwrapper without sudo as a normal user pip will run but won't copy the files in the required locations because the lack of permissions.

    mortiz@florida:~# sudo pip3 install virtualenvwrapper
    

    Use sudo and the files will be created under their respective paths:

    root@florida:/usr/local/bin# ls -ltr
    total 8008
    -rwxr-xr-x 1 root staff 8136192 Jun 11 17:45 chromedriver
    -rwxr-xr-x 1 root staff   41697 Sep  5 16:06 virtualenvwrapper.sh
    -rwxr-xr-x 1 root staff    2210 Sep  5 16:06 virtualenvwrapper_lazy.sh
    -rwxr-xr-x 1 root staff     215 Sep  5 16:06 pbr
    -rwxr-xr-x 1 root staff     218 Sep  5 16:06 virtualenv-clone
    -rwxr-xr-x 1 root staff     213 Sep  5 16:06 virtualenv
    root@florida:/usr/local/bin# 
    

    Worked for me on Debian GNU/Linux 9

  25. mobadara respuesta 2025-03-18 22:29

    I am using WSL Ubuntu 24.04 LTS. After struggling with this situation for about four hours, I found a simple solution.

    $ sudo apt install python3-pipx

    $ pipx install virtualenvwrapper

    Add the following to your configuration file

    export WORKON_HOME=$HOME/.virtualenvs
    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 #or where your python 3 is installed.
    source ~/.local/bin/virtualenvwrapper.sh
    

    and that's it.

  26. Yuanxu Xu respuesta -1 2016-11-04 20:48

    in my case: /home/username/.local/bin/virtualenvwrapper.sh

  27. bcye respuesta -2 2017-12-14 20:59

    Have you installed it using sudo? Was the error in my case.

← todos los hilos de StackOverflow