0

Added to ~/.bash_profile

PATH=c:/Python27:$PATH

and

env | grep PATH

shows the path c:/Python27

However I cannot run python interpreter from command line in bash. I'm on Windows 7 and I can run python from any directory in command prompt after doing

path %path%;C:\Python

Or adding the path to my Environment Variables

In bash I am able to do other commands from any directory in terminal after adding their path to ~/.bash_profile given the path is a sub-directory of ~/

If the path in .bash_profile is C:/ rather than ~/ it doesn't work. So my question is when adding a path to .bash_profile where the location is in C:/ rather than ~/ how do i do it?

2
  • Is the interpreter in C:\Python27 or in C:\Python, as your cmd example suggests? Commented Oct 10, 2013 at 21:37
  • C:\Python27 I was being dumb :) Commented Feb 1, 2015 at 18:28

1 Answer 1

1

Bash uses : as the path separator, so you actually just added "c" and "/Python27" to your PATH.

Different Windows GNU toolset ports have different ways of working around this. You can try ls /c/, ls /cygdrive/c or read your port's documentation to see how it handles this.

If you find that e.g. /c/Python27 is mapped to c:\Python27, then you can add that to your path instead.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks I should've known. Brain fart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.