python-virtualenvwrapper / virtualenvwrapper

Other
124 stars 17 forks source link

ERROR: Environment does not contain activate script. #101

Open quantitative-technologies opened 3 months ago

quantitative-technologies commented 3 months ago

I'm using Ubuntu 22.04.2 on an AWS server.

virtualenvwrapper was installed the same way I have done for years.

But now when I try to create a virtualenv I get the error:

ubuntu@ip-172-31-36-200:~$ mkvirtualenv bot                                                                                                                                                                        
created virtual environment CPython3.10.12.final.0-64 in 1039ms                                                                                                                                                    
  creator CPython3Posix(dest=/home/ubuntu/.virtualenvs/bot, clear=False, no_vcs_ignore=False, global=False)                                                                                                        
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ubuntu/.local/share/virtualenv)                                                                     
    added seed packages: pip==24.1, setuptools==70.1.0, wheel==0.43.0                                                                                                                                              
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator                                                                                                      
virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/bot/bin/predeactivate                                                                                                                            
virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/bot/bin/postdeactivate                                                                                                                           
virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/bot/bin/preactivate                                                                                                                              
virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/bot/bin/postactivate                                                                                                                             
virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/bot/bin/get_env_details                                                                                                                          
ERROR: Environment '/home/ubuntu/.virtualenvs/bot' does not contain an activate script.                                                                                                                            
dhellmann commented 3 months ago

Which version of virtualenv are you using?

quantitative-technologies commented 3 months ago

Hello,

This is occurring with 20.26.3:

ubuntu@ip-172-31-36-200:~$ pip show virtualenv
Name: virtualenv
Version: 20.26.3
Summary: Virtual Python Environment builder
Home-page: https://github.com/pypa/virtualenv
Author: 
Author-email: 
License: 
Location: /home/ubuntu/.local/lib/python3.10/site-packages
Requires: distlib, filelock, platformdirs
Required-by: virtualenvwrapper
dhellmann commented 3 months ago

Does /home/ubuntu/.virtualenvs/bot/bin/activate exist and is it a file?

quantitative-technologies commented 3 months ago

Correct:

ubuntu@ip-172-31-36-200:~/.virtualenvs/bot/bin$ ls -l
total 76
-rw-rw-r-- 1 ubuntu ubuntu 2241 Jun 24 22:21 activate
-rw-rw-r-- 1 ubuntu ubuntu 1500 Jun 24 22:21 activate.csh
-rw-rw-r-- 1 ubuntu ubuntu 3064 Jun 24 22:21 activate.fish
-rw-rw-r-- 1 ubuntu ubuntu 2748 Jun 24 22:21 activate.nu
-rw-rw-r-- 1 ubuntu ubuntu 1653 Jun 24 22:21 activate.ps1
-rw-rw-r-- 1 ubuntu ubuntu 1303 Jun 24 22:21 activate_this.py
-rwxr-xr-x 1 ubuntu ubuntu  150 Jun 24 22:21 get_env_details
-rwxrwxr-x 1 ubuntu ubuntu  245 Jun 24 22:21 pip
-rwxrwxr-x 1 ubuntu ubuntu  245 Jun 24 22:21 pip-3.10
-rwxrwxr-x 1 ubuntu ubuntu  245 Jun 24 22:21 pip3
-rwxrwxr-x 1 ubuntu ubuntu  245 Jun 24 22:21 pip3.10
-rw-r--r-- 1 ubuntu ubuntu   72 Jun 24 22:21 postactivate
-rw-r--r-- 1 ubuntu ubuntu   74 Jun 24 22:21 postdeactivate
-rwxr-xr-x 1 ubuntu ubuntu   69 Jun 24 22:21 preactivate
-rw-r--r-- 1 ubuntu ubuntu   75 Jun 24 22:21 predeactivate
lrwxrwxrwx 1 ubuntu ubuntu   16 Jun 24 22:21 python -> /usr/bin/python3
lrwxrwxrwx 1 ubuntu ubuntu    6 Jun 24 22:21 python3 -> python
lrwxrwxrwx 1 ubuntu ubuntu    6 Jun 24 22:21 python3.10 -> python
-rwxrwxr-x 1 ubuntu ubuntu  232 Jun 24 22:21 wheel
-rwxrwxr-x 1 ubuntu ubuntu  232 Jun 24 22:21 wheel-3.10
-rwxrwxr-x 1 ubuntu ubuntu  232 Jun 24 22:21 wheel3
-rwxrwxr-x 1 ubuntu ubuntu  232 Jun 24 22:21 wheel3.10
dhellmann commented 1 month ago

Do you have any other overrides or shell aliases for commands like ls or find? What other virtualenvwrapper settings do you have configured?