1

I'm a newbie so excuse my poor use of terms.

I'm facing a problem in configuring git bash on windows to run python and anaconda and jupyter notebook as well.

I inserted the path I got for anaconda, python, and jupyter notebook from my Anaconda prompt and inserted the paths I got into this code (export PATH="$PATH:[YOUR_PATH]:[YOUR_PATH]/Scripts") into my .bashrc document in home directory.

Those are the commands I added to the .bashrc file: export

export PATH="$PATH:/c/ProgramData/Anaconda3/python.exe:/c/ProgramData/Anaconda3/python.exe/Scripts"

export PATH="$PATH:/c\ProgramData\Anaconda3\Library\bin\conda.bat:/c\ProgramData\Anaconda3\Library\bin\conda.bat/Scripts"

export PATH="$PATH:/c\ProgramData\Anaconda3\Scripts\conda.exe:/c\ProgramData\Anaconda3\Scripts\conda.exe/Scripts"

export PATH="$PATH:/c\ProgramData\Anaconda3\condabin\conda.bat:/c\ProgramData\Anaconda3\condabin\conda.bat/Scripts"

export PATH="$PATH:/c\ProgramData\Anaconda3\Scripts\jupyter.exe:/c\ProgramData\Anaconda3\Scripts\jupyter.exe/Scripts"

alias python="winpty python.exe"

Since I added alias for python, when I type $ python --version, the result I get is (winpty: error: cannot start 'python.exe' : Not found in PATH)

Saleh
  • 11
  • 1
  • 1
    Leave out the `.exe` files in the `PATH`. `PATH` should only point to directories containing executables. Besides, `/c/ProgramData/Anaconda3/python.exe/Scripts` is probably an invalid path anyway – FlyingTeller Sep 11 '19 at 12:44
  • Thanks for the quick reply! I took out .exe and /Scripts out of them, and also tried to only take out /Scripts and keep .exe and still, it gives me the same message: winpty: error: cannot start 'python.exe': Not found in PATH – Saleh Sep 11 '19 at 12:47
  • Did you `echo $PATH` to check if it now contains a valid directory containing `python.exe?` – FlyingTeller Sep 11 '19 at 12:49
  • Wow, this is the first question I post here, and I'm really impressed with your quick responses. Anyways, I used `echo $PATH` and I get this in the end of the paths it is showing: `:/c/ProgramData/Anaconda3/python.exe:/c/ProgramData/Anaconda3/python.exe:/c\ProgramData\Anaconda3\Library\bin\conda.bat:/c\ProgramData\Anaconda3\Library\bin\conda:/c\ProgramData\Anaconda3\Scripts\conda.exe:/c\ProgramData\Anaconda3\Scripts\conda:/c\ProgramData\Anaconda3\condabin\conda.bat:/c\ProgramData\Anaconda3\condabin\conda:/c\ProgramData\Anaconda3\Scripts\jupyter.exe:/c\ProgramData\Anaconda3\Scripts\jupyter ` – Saleh Sep 11 '19 at 12:53
  • Looks like `/c/ProgramData/Anaconda3` (without `\python3.exe`) ist still missing – FlyingTeller Sep 11 '19 at 13:04
  • Conda supports auto-managing `.bashrc` for Git Bash using the `conda init` function (see [this answer](https://stackoverflow.com/a/55526573/570918)). Users have been discouraged from manually manipulating `$PATH` since Conda v4.4, so if you want to follow best practice, I'd recommend deleting all of those exports and following the commands in the other question, making sure to run `conda init` inside Git Bash. – merv Sep 11 '19 at 16:09
  • I tried to use `conda init` in bash but it said there is no command like that. But thanks anyways, I'm installing a dual ubunto system, it seems like Linux would be way much easier and better in the long run. Thanks guys. – Saleh Sep 11 '19 at 20:19

0 Answers0