Where is virtualenvwrapper.sh after pip install?

127,016

Solution 1

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

Solution 2

did you already try this ?

$ which virtualenvwrapper.sh

Solution 3

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)

Solution 4

I just reinstalled it with pip.

sudo pip uninstall virtualenvwrapper
sudo pip install virtualenvwrapper

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

Solution 5

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

Share:
127,016
zakdances
Author by

zakdances

Updated on May 15, 2020

Comments

  • zakdances
    zakdances about 4 years

    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
      Hartley Brody over 2 years
      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!
  • zakdances
    zakdances over 11 years
    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
  • zakdances
    zakdances almost 11 years
    this works, but why doesn't which virtualenvwrapper work? Isn't that the name of the command in the environmental variables?
  • Tim
    Tim almost 11 years
    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.
  • Serhii Holinei
    Serhii Holinei over 10 years
    Worked for me. Thanks
  • psycat
    psycat about 9 years
    to get rid of 'permission denied' you can redirect STDERR to /dev/null. For example: $ find / -name virtualenvwrapper.sh 2>/dev/null
  • tenfishsticks
    tenfishsticks about 9 years
    @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
  • eddiemoya
    eddiemoya almost 9 years
    This worked for me on Ubuntu, also allowing which virtualenvwrapper.sh to work, which had been returning nothing until I did this.
  • tomaskazemekas
    tomaskazemekas about 8 years
    After this command on Fedora 23 I have found virtualenvwrapper.sh only in usr/bin .
  • hermgerm
    hermgerm almost 8 years
    Had initially installed it with apt-get and it landed in /usr/share/virtualenvwrapper/virtualenvwrapper.sh, then purged it and did your trick.
  • Siladittya
    Siladittya over 6 years
    This happened for me too. :(
  • danagerous
    danagerous over 6 years
    This was much faster than find but both worked. Mine was located in usr/local/bin on OS X.
  • whyisyoung
    whyisyoung about 6 years
    It didn't work for me. I'm using Python 2.7.14 with Virtualenv 15.1.0 , virtualenvwrapper 4.8.2.
  • Anuj Gupta
    Anuj Gupta about 6 years
    @whyisyoung : seriously? can you send me the screen shot right after you run "pip uninstall virtualenvwrapper"
  • Alan
    Alan over 5 years
    This worked for me in Ubuntu 14.04 if you find / -name xxxx.sh didn't find anything.
  • Mahesh Vemula
    Mahesh Vemula about 5 years
    Nice shortcut. I am using this even for other libraries. Thank!
  • Reuel Ribeiro
    Reuel Ribeiro about 4 years
    On Manjaro, arch based, it was also located under /usr/bin instead of /usr/local/bin. I don't know why.
  • MiGu3X
    MiGu3X over 3 years
    Same for ubuntu 20.04
  • robertspierre
    robertspierre over 3 years
    On Ubuntu 20.10, it is also installed in ~/.local/bin/virtualenvwrapper.sh
  • Karan Singh
    Karan Singh over 3 years
    On Ubuntu 16.04, it is installed in ~/.local/bin/virtualenvwrapper.sh