0

This is my first time using GitBash. Faced a problem when GitBash couldn't find my python:

$ python --version bash: python: command not found

Then I tried to fix it with:

export PATH='$PATH:/c/Users/usr/anaconda3'

After that python commands started to work but some other were lost: $ ls bash: ls: command not found

Found one simmilar case but didn't quite understand what I have to do Windows 10, Git Bash - bash: git: command not found

tripleee
  • 175,061
  • 34
  • 275
  • 318
David.I
  • 11
  • 1
  • 1
    You need to use double quote export PATH="$PATH:/c/Users/usr/anaconda3" – koolwithk Jan 16 '22 at 19:25
  • After installing have you restarted git-bash? – evolutionxbox Jan 16 '22 at 19:25
  • 1
    @koolwithk is correct: you broke your PATH setting by making it contain the literal string `$PATH`, rather than the value of the previous `$PATH` plus the `/c/User/usr/anaconda3` directory. – torek Jan 16 '22 at 19:29
  • Does this answer your question? [Difference between single and double quotes in Bash](https://stackoverflow.com/questions/6697753/difference-between-single-and-double-quotes-in-bash) – tripleee Feb 27 '23 at 17:26
  • Possible duplicate of https://stackoverflow.com/questions/39795766/how-to-edit-corrupted-bash-profile – tripleee Feb 27 '23 at 17:27

1 Answers1

0

Hey pretty sure you need to do it without the quotes: export PATH=$PATH:/c/Users/usr/anaconda3

See image: example image

Anyway, after restarting gitbash the PATH variable should revert to its default value. If it doesn't i suggest adding the following to the path:

/c/Users/<YOUR_HOSTNAME>/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin
NoobSlayer
  • 46
  • 2