473,413 Members | 1,731 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

how to set environment variables for using python

I am unable to run any python program from command prompt(unless i run it from the python directory)
e.g i hav python stored as C:\python25
I cannot run python programs from elsewhere as python command is not recognizable elsewhere.
what do i need to do??can anyone guide me?
Dec 5 '06 #1
3 4116
fuffens
38
On a Windows system you just add the folder of the Python executable to your Path environment variable.

1. Go to Control Desk
2. Select System
3. In System Properties, select Advanced tab
4. Select Environment Variables
5. Edit your Path variable. Add C:\python25 to the list of paths.

You might have to restart your computer in order for it to work.
Best Regards
/Fredrik
Dec 5 '06 #2
bartonc
6,596 Expert 4TB
On a Windows system you just add the folder of the Python executable to your Path environment variable.

1. Go to Control Desk
2. Select System
3. In System Properties, select Advanced tab
4. Select Environment Variables
5. Edit your Path variable. Add C:\python25 to the list of paths.

You might have to restart your computer in order for it to work.
Best Regards
/Fredrik
Fredrik, what's Control Desk (it definitely sounds like something I should know about)?

learnerofpython, if you have the same question, right click My Computer go to Advanced tab of System Properties click Environment Variables. Path names can be copied from and explorer window. They are separated by semicolon in the PATH variable (which should be the top one). Hope this helps,
Barton
Dec 5 '06 #3
bartonc
6,596 Expert 4TB
Fredrik, what's Control Desk (it definitely sounds like something I should know about)?

learnerofpython, if you have the same question, right click My Computer go to Advanced tab of System Properties click Environment Variables. Path names can be copied from and explorer window. They are separated by semicolon in the PATH variable (which should be the top one). Hope this helps,
Barton
Oh, I see... Control Panel: System icon.
Dec 5 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: sebastien.hugues | last post by:
Hi I would like to retrieve the application data directory path of the logged user on windows XP. To achieve this goal i use the environment variable APPDATA. The logged user has this name:...
0
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to...
3
by: Greg Lindstrom | last post by:
Hello- I am running python 2.3. on an HP-9000 box running Unix and have a POSIX script that sets up my production environment. I would like to run the script from inside a python routine and...
6
by: Fuzzyman | last post by:
Hello all, I would like to set a Windows Environment variable for another (non-child) process. This means that the following *doesn't* work : :: os.environ = value In the ``win32api``...
3
by: Tristan | last post by:
Hello community: I post this because I could not find satisfactory answers in the posts generated by this nice group. I work on winXP. I have many little python applications in different folders,...
2
by: Henry Hollenberg | last post by:
Hello, I have written a script that uses environment variables set during a particular users login in ".bash_profile" and ".profile". I have changed to that users uid and gid in my python...
4
by: Krishna | last post by:
Environment variable set up is the most confusing part for me all the time. Please help me with the following questions: When I install python in a new system, I will go to environment variables...
4
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
1
by: replysonika | last post by:
Hello, I run a Java app with subprocess from Python script. This python script is called from another Python Wrapper. python = subprocess.Popen(, stdout=subprocess.PIPE,...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.