No able to activate a virtual env on pycharm

Dear Python community.

the issue I am facing is i am not able to activate a virtual env. using Pycharm app.

Please not the following:

  1. I have a folder with a project running python/Django, named “Production” copied in an external hard drive, the project folder was copied from a ubuntu server running in a primary testing server.
  2. Then, I created and config a second testing server running the latest LTS Ubuntu version and install python, pycharm, Django, postgresql;
  3. Then I copied the project folder named “Production” I have in the external hard drive to the /home/user_folder/ folder location in Ubunto server. So, the route I copied the folder is the following /home/user_folder/Production.
  4. The folder “Production” had a folder name venv, what was the virtual environment on the primary testing server. But I renamed that folder to venv_old, to I created a new virtual env on second testing server,
  5. The new virtual env I created by clicking on pycharm “File” menu, then go to “Settings”, go to “Python Interpreter” and finally click on “Add Interpreter.”
  6. On the “Add Python Interpreter” windows I checked the checkbox “Inherit global site-packages”. You can refer to image below.
  7. Then a new venv folder was created inside the “Production” folder
  8. On the pycharm I go to terminal and navigate until the venv folder just created. Inside of it I have the bin folder and inside of it I have the activate filed, activate, activate.csh, activate.fish, activate.ps1, among other.
  9. But when I run: ~/production$ venv/bin/activate the terminal shows a message Permission denied (commando Permissão negada)  since the server is setting in Portuguese.
  10. But when I run ~/production$ venv/bin/activate the terminal shows a message command not found (commando não encontrado)  since the server is setting in Portuguese.
  11. Note when I run $python3 --version, it shows  Python 3.12.3
  12. When I run # pip --version, it shows  pip 24.0 from /user/lib/python3/dist-packages/pip (python3.12)

I have no idea why I am getting the error “Command not found” when try to activate my virtual env. If someone can give me help, I will really appreciate.
Thanks in advance.

The command to activate a venv is source venv/bin/activate.

1 Like

thank you Alexander

I was so used to running it from powershell on windows, that I didn’t use the source command.

Thank you so much

2 Likes