Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jul 28 '13 at 7:06

This question came from our site for professional and enthusiast programmers.

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

3 Answers 3

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).

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.