Error: Environment /Users/myuser/.virtualenvs/iron does not contain activation script

I'm running on a raspbian buster with Python 3.7.3. I ran into the same issue, "ERROR...no activation script". I tried @Lombax answer but it didn't work.

However, I noticed that the version of virtualenvwrapper I had installed was 5.0.0. I checked on PyPi and it's still at version 4.8.4. So I uninstalled virtualenv and virtualenvwrapper: sudo pip3 uninstall virtualenv virtualenvwrapper.

Then I reinstalled both and specified the version: sudo pip3 install virtualenv virtualenvwrapper=='4.8.4' I sourced my .bashrc, in which I had appended the settings:

VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export PATH=/usr/local/bin:$PATH
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

And now mkvirtualenv test works. Not sure what's the bug with version 5.x of virtualenvwrapper, in the meantime, this got around the problem for me, hope this helps.


I had the same error message when I used mkvirtualenv on a new RPI4. I added these lines to my .bashrc and it fixed the problem for me:

export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
export VIRTUALENVWRAPPER_ENV_BIN_DIR=bin  # <== This line fixed it for me

This is a variation of the answer from @maxmcmahon, above, but setting VIRTUALENVWRAPPER_ENV_BIN_DIR to "bin". I did not need to change the versions of either virtualenv or virtualenvwrapper; the current versions installed by default were fine.


My solution was to add export VIRTUALENVWRAPPER_ENV_BIN_DIR=usr/local/bin to my shell startup file after the virtualenvwrapper.sh script gets called.

I figured out this fix after looking at the source and seeing that it was creating the activate script in usr/local/bin, but the virtualenvwrapper.sh script was looking in just bin for some reason.

My full shell startup config is now this:

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