Permission denied when activating venv

Viewed 140693

I just started a new python project and created a venv inside the project folder by running virtualenv venv in the terminal. However, when I run venv/bin/activate I get a permission denied error.

I have tried

sudo chown -R user:user project/venv

but I get

chown: user: illegal group name

I have set these venvs up a ton of times and never had the issue. Is there anything else I can try?

I am on a Mac.

8 Answers

On my VSC, I used these and it worked.

python3 -m venv .venv

source .venv/bin/activate

I had the same problem and this worked for me:. venv/bin/activate

source venv/bin/activate

source venv/bin/activate

activated successfully 'source' command need to add before full path of activation file.

Ex.

  • Source your_project_folder_path/venv/bin/activate

**

if you're inside project folder then following command-

  • Source venv/bin/activate

.

enter image description hereFrom within the virtual environment folder can type:

source ./bin/activate

and yes if you run into the permission issue then go one folder up and do the source ./foldervirtualenvironment/bin/activate

From the command line root enter:

source /home/<your_username>/<app_folder>/<venv_name>/bin/activate

Worked for me

go to activate file right click and open properties-->permissions

and check Execute

open this image:

enter image description here

Related