1

I use a RPI3B and try to install Virtualenvwrapper and Virtualenvs. After i add the

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

in the ~/.profile. Then source ~ ~/.profile I use mkvirtualenv cv -p python2. After that i get these message :

created virtual environment CPython2.7.16.final.0-32 in 672ms
creator CPython2Posix(dest=/home/pi/.virtualenvs/cv, clear=False, global=False)
seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, 
app_data_dir=/home/pi/.local/share/virtualenv/seed-v1)
activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
virtualenvwrapper.user_scripts creating /home/pi/.virtualenvs/cv/usr/local/bin/predeactivate
ERROR: Environment '/home/pi/.virtualenvs/cv' does not contain an activate script.

But i cant use workon cv. The last Message come again and again. How can i fix it? I also try it to reinstall but it doesnt help.

phd
  • 82,685
  • 13
  • 120
  • 165
reven102
  • 35
  • 1
  • 5
  • Does this answer your question? [Activating environment in virtualenvwrapper](https://stackoverflow.com/questions/34239037/activating-environment-in-virtualenvwrapper) – AMC Feb 25 '20 at 01:08
  • Something here helps? https://stackoverflow.com/q/60252119/7976758 Found in https://stackoverflow.com/search?q=%5Bvirtualenvwrapper%5D+Environment+does+not+contain+an+activate+script – phd Feb 25 '20 at 07:37
  • thanks. To Fix it the you need to install virtualwrapper version 4.8.4 than it works. – reven102 Feb 25 '20 at 19:08

1 Answers1

8

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
Jeff Bass
  • 336
  • 3
  • 7
  • 2
    This was the exact error I had at the exact same step. The answer by Jeff Bass indeed solved my problem too. – GIZNAJ Mar 20 '20 at 18:24