Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

activate virtualenv in git bash using pycharm on windows

I have activated git bash instead of command prompt (cmd) in Pycharm. Whenever I try to activate the virtualenv, which is named venv, I face with two problems:

  1. After I execute source venv/Scripts/activate, face with the following error:
bash: basename: command not found
()

which (I think) means that it doesn't recognize source command.

  1. Running ./venv/Scripts/activate has also another problem:
You must source this script: $ source ./venv/Scripts/activate
()

What should I do?

pycharm terminal

PS: Also <exact-directory>/venv/Scripts/activate works properly in cmd.

like image 954
Mostafa Ghadimi Avatar asked Dec 13 '22 10:12

Mostafa Ghadimi


1 Answers

There is a setting in File > Settings > Terminal for "Activate virtualenv". This works for cmd shell, but seems not to work with bash in Windows 10. If I uncheck that setting, 'source venv/Scripts/activate' activates as expected.

like image 75
Nikki Avatar answered Dec 22 '22 17:12

Nikki