0

I need to install python in my computer. I searched some articles on the internet and it says to set the environment variables as follows.

set path=%path%;C:\Python27\

So the problem is that the existing values for this path variable in my computer is for java. And I want to know if I set this like this, will there be any problem in compiling my java files. Or if there is another better way to do this.

4
  • 2
    Have you tried setting it yet? If so, what happened? (Remember, you can always set PATH=YOUR_OLD_PATH). Jul 27, 2013 at 1:08
  • 2
    What do you think the %path%; part of that does?
    – Matt Ball
    Jul 27, 2013 at 1:09
  • > I want to know if I set this like this, will there be any problem in compiling my java files. NO. Jul 28, 2013 at 7:10
  • How do I install Microsoft Office when Google Chrome is still there on the computer???? Jul 28, 2013 at 7:12

3 Answers 3

4

The snippet you posted will append to your path variable; it won't replace it. Logically, it's analogous to message = message + "!". So if your %path% looks like this now:

C:\jdk\bin

...then running the snippet you've been given will change it to read:

C:\jdk\bin;C:\Python27\

...which is normal and just fine.

The semicolon separates elements of the path environment variable. If you try to execute python.exe from the command line, Windows will first search for that executable in C:\jdk\bin (where it won't be found), and then C:\Python27\ (where it will).

1

They are absolutely not related to each other. You can append to path as many folders, as you want (with ; as delimeter)/

0

The solution you show works for a single console session, but that's likely not what you want. Its better to update the system PATH so that python is always available.

In windows, it is common to install python with an installer (an exe or msi) from python.org, activestate.com, or other site. That installer likely setup the path for you. After install, open a new command prompt and type 'python' to see if it works. If it does, you're done.

If that doesn't work, you want to update the path in Windows System Properties. There are various ways to get there, but usually pressing the Start button, right clicking Computer and then navigating to Properties >> Advanced System Settings >> Advanced >> Environment Variables >> System Variables >> PATH will do it. Just add ";C:\Python27" to the end of the existing path statement.

But be warned: If you mess up the system PATH variable your computer is basically hosed. No pressure.

You must log in to answer this question.