473,750 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why XP can not run Python after being setting the PATH?

Hello all:

I have set the PATH for Python as follows:

My Computer->Properties->Advanced->Environment Variables->System
Variables->Path

....; C:\Program Files\Python24;

Then I try to run python under command line

C:\>python

C:\>python.exe

I got nothing:)

It works iff I run as follows:

C:\>"Program Files\Python24\ python.exe"
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>>>
My question is how I can set the path so that the XP can run python
without the full path?
Thank you very much
-Daniel

Jul 28 '06 #1
10 2341
Ray
By any chance the command window hasn't been restarted after you've
changed the PATH? Strange that looks OK.

If you do echo %PATH% what does it tell you, is Python there?

Cheers
Ray

Daniel Mark wrote:
Hello all:

I have set the PATH for Python as follows:

My Computer->Properties->Advanced->Environment Variables->System
Variables->Path

...; C:\Program Files\Python24;

Then I try to run python under command line

C:\>python

C:\>python.exe

I got nothing:)

It works iff I run as follows:

C:\>"Program Files\Python24\ python.exe"
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>>

My question is how I can set the path so that the XP can run python
without the full path?
Thank you very much
-Daniel
Jul 28 '06 #2
Hello Dennis:
A second suggestion would be: don't install Python in "Program
Files", but put it at the top level of the partition (ie; C:\Python24\)
I guess your comment is right.
However, I would like to install Python under directory
"C:\Program Files\Python24"

Also, I list some screen shot from my machine as follows:

C:\Program Files\Python24> cd \

C:\>python

C:\>"Program Files\Python24\ python.exe"
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>>^Z

C:\>Program\ Files\Python24\ python.exe
'Program\' is not recognized as an internal or external command,
operable program or batch file.

C:\>python111
'python111' is not recognized as an internal or external command,
operable program or batch file.

It seems that XP know there is python.exe there, but cannot run it
correctly if
i use c:\python

The only way works on my machine is to run with full path.

Maybe there is not solution to this problem:)?

Thank you all:)

Jul 28 '06 #3
Hello Ray:

Python is on my Path list as follows:

C:\Program Files\Python24> echo %path%
C:\Program
Files\texmf\mik tex\bin;C:\WIND OWS\system32;C: \WINDOWS;C:\cyg win\usr\local\b in;c:\cygwin\bi n;C:\P
rogram Files\Java\jdk1 .5.0_06\bin;C:\ Program
Files\gp400win3 2\gnuplot\bi
n;C:\Program Files\Python24; C:\Program Files\j2sdk1.4. 2_09\bin;

So I don't think that is the real problem:)
thank you

Ray wrote:
By any chance the command window hasn't been restarted after you've
changed the PATH? Strange that looks OK.

If you do echo %PATH% what does it tell you, is Python there?

Cheers
Ray

Daniel Mark wrote:
Hello all:

I have set the PATH for Python as follows:

My Computer->Properties->Advanced->Environment Variables->System
Variables->Path

...; C:\Program Files\Python24;

Then I try to run python under command line

C:\>python

C:\>python.exe

I got nothing:)

It works iff I run as follows:

C:\>"Program Files\Python24\ python.exe"
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>>>
My question is how I can set the path so that the XP can run python
without the full path?
Thank you very much
-Daniel
Jul 28 '06 #4
Daniel Mark wrote:
Maybe there is not solution to this problem:)?
Did you not try Sybren's suggestion? Remove the space between the
semicolon and the path and it should work. It worked (and didn't work)
for me when I tested it.
Jul 28 '06 #5
Dumb question... but you're 100% positive your python install is in
"C:\Program Files\Python24" and not just "C:\Python2 4" Right?
Also, an alternative approach to being able to run python from the
command line is to add it to the path variable in each instance of
cmd.exe when it starts up. To do this, run regedit, then edit the key
"HKEY_CURRENT_U SER\Software\Mi crosoft\Command Process\AutoRun " You
might have to add the key autorun if it's not there, and this can be
done in CURRENT_USER or LOCAL_MACHINE. Enter the value :

PATH %PATH%;C:\progr a~1\python24;
I use this approach to add directories containing other command line
tools that I don't necessarily want in the path all the time since a
cluttered path can cause problems sometimes.

Jul 28 '06 #6
Hello John:

I did try, however, it doesn't work on my machine.
Thank you
-Daniel
John Salerno wrote:
Daniel Mark wrote:
Maybe there is not solution to this problem:)?

Did you not try Sybren's suggestion? Remove the space between the
semicolon and the path and it should work. It worked (and didn't work)
for me when I tested it.
Jul 28 '06 #7
Daniel Mark wrote:
Hello John:

I did try, however, it doesn't work on my machine.
Thank you
-Daniel
John Salerno wrote:
>Daniel Mark wrote:
>>Maybe there is not solution to this problem:)?
Did you not try Sybren's suggestion? Remove the space between the
semicolon and the path and it should work. It worked (and didn't work)
for me when I tested it.
well that is baffling...it works normally otherwise? there could be
something wrong with the installation maybe, but the line you have in
the PATH (without spaces) should work...putting quotes around "Program
File" doesn't seem to be required...

let me know if you figure it out! i'll keep thinking....
Jul 28 '06 #8
Daniel Mark wrote:
>
Also, I list some screen shot from my machine as follows:

C:\Program Files\Python24> cd \

C:\>python
#### Note: *no* error message !!! [or you edited the screen shot]

Hypothesis: there is something called python.exe or python.bat or
whatever somewhere in your path before the c:\program files\python24
[*OR* in the root (c:\) folder!!!]. When run, it does nothing (we
hope!).

Try getting it to mumble something that might reveal its identity, by
typing something like

C:\>python -h
C:\>python /?
C:\>python foo bar zot

Have a look in each of those folders (including the root!!) and see
what you find there. [If I were forced to bet, I'd put my money on
cygwin].
Then either adjust your path or blow away the intruder. If you aren't
sure which is more appropriate, ask.

BTW, most folk got out of the habit of issuing commands at the root
directory level (and keeping files at that level) pretty soon after
MS-DOS 2.0 came out. Following that herd is not such a bad idea :-)
C:\>"Program Files\Python24\ python.exe"
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)]
on win32
Type "help", "copyright" , "credits" or "license" for more information.
>^Z


C:\>Program\ Files\Python24\ python.exe
'Program\' is not recognized as an internal or external command,
operable program or batch file.
#### This is the expected error message.
>
C:\>python111
'python111' is not recognized as an internal or external command,
operable program or batch file.

It seems that XP know there is python.exe there, but cannot run it
correctly if
i use c:\python

The only way works on my machine is to run with full path.

Maybe there is not solution to this problem:)?
Jul 28 '06 #9
Dear John:
Have a look in each of those folders (including the root!!) and see
what you find there. [If I were forced to bet, I'd put my money on
cygwin].
You are a genius!!!

My machine was intalled python in cygwin:)

I didn't expect that I could get so much helps from this forum.
My heartfelt thanks go out to John and all friends here:)

-Daniel

Jul 28 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1669
by: Rhamphoryncus | last post by:
First a bit about myself. I've been programming in python several years now, and I've got several more years before that with C. I've got a lot of interest in the more theoretical stuff (language design, component architectures, etc). Of late my focus has been on concurrent operations (and on how to design a GUI architecture, but that's not what this post is about). I've looked at threads, and the inability to kill them easily was a...
1
6504
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
15
2959
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility, controlled via Plesk control panel, and turned over to me with Fedora Core 6 in an empty state. This is the standard way you get a server in a colo today. Bringing Python up in this completely clean environment is a huge hassle, and it doesn't...
0
9001
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9342
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8263
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6808
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6081
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.