3

After embedding Git-Bash in PyCharm (2019.1.3 CE) on Windows following this thread (or this one) I've encountered a following problem using virtual environment (created with stdlib venv package):

  • PyCharm fails to automatically activate virtual environment.
  • After manual activation (which can be done following this thread) some Bash commands (like git/rm) went missing:

    $ git status
    On branch ...
    Your branch is up to date with '.../...'.
    
    nothing to commit, working tree clean
    
    $ . venv/Scripts/activate
    
    (venv) $ git status
    bash: git: command not found
    

Even after deactivation

(venv) $ deactivate

$ git status
bash: git: command not found

they are not accessible.

Azat Ibrakov
  • 9,998
  • 9
  • 38
  • 50

1 Answers1

4

As a workaround I've ended up disabling option "Activate virtualenv" in File -> Settings -> Tools -> Terminal menu:

Settings

and after saving changes & reopening terminal it seems to work

$ . venv/Scripts/activate

(venv) $ git status
On branch ...
Your branch is up to date with '.../...'.

nothing to commit, working tree clean
Azat Ibrakov
  • 9,998
  • 9
  • 38
  • 50