Django tutorial: Running into an issue installing virtualenvwrapper

Hi there,

I’m moving through the Django tutorials and am on the ‘Setting up a Django development environment’ page. Just to note: I’m on OSX, the latest version of High Sierra. I can successfully install Python 3.7 and using pip3 to install ‘virtualenvwrapper’ seems to work fine, but when I execute source ~/.bashrc to reload the startup file, I get a series of warnings from npm and finally a line reading -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory.

I’ve already tried uninstalling and reinstalling python, but that doesn’t seem to have resolved the issue. Has anyone else had this program? Does anyone have any suggestions for how to diagnose or address the issue I’m running into?

Thanks for any help in advance!

Just to let you know, I’ve also run into the same problem. There seems to be something that has changed in the set up of Python3 or virtualenv/virtualendwrapper, which means that the shell script is no longer being placed in the same directory during installation. We are looking into a solution for this, and will hopefully have something to report soon.

1 Like

Thanks Chris, I appreciate it!

The bash script sets where the system should find both Python (for use by virtualenv) and runs the virtualenvwrapper.sh script. Typically they will both be as shown below (see lines 2, 3)

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export PROJECT_HOME=$HOME/Devel
source /usr/local/bin/virtualenvwrapper.sh

If this does not work, then it is most likely that either or both of the lines 2 and 3 are wrong for your system.

The way to fix this is to run which virtualenvwrapper.sh and which python3 and put the locations that are found into the script instead.

1 Like

Thanks Hamish, this is helpful. If I replace lines 2 and 3 with the locations I find from running which, would there be anything I need to keep in mind while completing the rest of the Django tutorials?

No :slight_smile:
Once those are set up the environment should just work like magic.

1 Like