镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ERROR: Environment does not contain activate script. #101

Description

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.                                                                                                                            

Activity

  1. dhellmann commented on Jun 27, 2024

    @dhellmann
    Contributor

    Which version of virtualenv are you using?

  2. quantitative-technologies commented on Jun 30, 2024

    @quantitative-technologies
    Author

    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
    
  3. dhellmann commented on Jun 30, 2024

    @dhellmann
    Contributor

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

  4. quantitative-technologies commented on Jul 4, 2024

    @quantitative-technologies
    Author

    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
  5. dhellmann commented on Sep 2, 2024

    @dhellmann
    Contributor

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

  6. jvernonc commented on Nov 10, 2025

    @jvernonc

    I received this message in a very different environment: using Windows python from an msys2/ucrt64 shell. The VIRTUALENVWRAPPER_ENV_BIN_DIR was not set correctly because UCRT64 is not considered in the cases for the MSYSTEM variable. Everything seems to work properly now that I added that test.

    It would/could be helpful to dump all VIRTUALENVWRAPPER environment variables in cases like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions