0

if I installed Python program in my E drive not C drive, is it the necessary that I must execute python files in the same drive that I installed python program in Command Prompt?

for example, I installed Python Program in my E drive. I can only be allowed to execute python files by following command?

E:\python34\python filename.py

NOT

C:\python34\python filename.py

or

E:\others_direactory\python filename.py

so, I always need to tell computer to use Python program to execute the python.py, otherwise it will alert "XXX is not recognized as an internal or external command, operable program or batch file".

is that right?

Thanks

Yu Xiong
  • 343
  • 2
  • 5
  • 13

2 Answers2

0

This post should explain how to set your environment variables.

How to add to the pythonpath in windows 7?

Community
  • 1
  • 1
0

Yes, you always have to tell the computer to use the python executable to execute python programs. It does not matter if you install to C: or E: drive either, you just always have to start out by specifying python executable. The program you are running is just an argument passed to it.

You can make it less of a pain by doing what @jake-griffin suggested and adding the location to your system Path variable so you only have to type python instead of the whole path to it.

ioscode
  • 801
  • 4
  • 12