473,396 Members | 1,998 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,396 software developers and data experts.

Path Problem on W2K?

I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
computer. When I write a Python script and run it from the command
prompt, I get the following error:

C:\>python 'name-of-script.py'
'python' is not recognized as an internal or external command,
operable program or batch file.

Here's what my path contains:

C:\>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\ Wbem;"C:\Program
Files\Norton
SystemWorks\Norton Ghost\";C:\Program Files\SSH Communications
Security\SSH Secu
re Shell

Any ideas? I've reinstalled and rebooted several times. Also tried
adding c:\Program Files\Python23 to my path... still get the error.
Jul 18 '05 #1
8 4334

"Bernard Delmée" <bd*****@advalvas.REMOVEME.be> a écrit dans le message
news: 3f**********************@feed0.news.be.easynet.net ...
Also tried adding c:\Program Files\Python23 to my path...


This should work, though! Still it's advisable to install to
a path without space(s), otherwise the "idle" IDE won't work.

Try with "C\Program Files\Python23" in your path (with the quotes). Could
help you (or not :-( )
If you change your path in the System box, I suspect (not sure) that you
need to open a new DOS box to have the new PATH.
Good luck.

Jul 18 '05 #2
On 17 Aug 2003 10:27:17 -0700, ho********@hotmail.com (hokiegal99) wrote:
I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
computer. When I write a Python script and run it from the command
prompt, I get the following error:

C:\>python 'name-of-script.py'
'python' is not recognized as an internal or external command,
operable program or batch file.

Here's what my path contains:

C:\>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32 \Wbem;"C:\Program
Files\Norton
SystemWorks\Norton Ghost\";C:\Program Files\SSH Communications
Security\SSH Secu
re Shell

Any ideas? I've reinstalled and rebooted several times. Also tried
adding c:\Program Files\Python23 to my path... still get the error.


I generally avoid installing in c:\Program<abominable_space>Files\anything.
The space just creates a nuisance when you want to use the path simply
in other contexts than they had in mind. Could be that's happening.

If you don't get a simple answer, I would uninstall and then reinstall as
c:\python23\... or c:\myInstalls\python23\ etc. I use a separate partition
and put it at D:\python23\...

Then add ;C:\python23 or whatever you decide (something without embedded spaces ;-)
onto the path.
( probably settings>control panel>system>environment>... or similar on your system).
If you are in a console window, you will have to restart that, at least, for the path
change to show up, if it works like mine.

HTH

Regards,
Bengt Richter
Jul 18 '05 #3
Bertrand Geston wrote:
"Bernard Delmée" <bd*****@advalvas.REMOVEME.be> a écrit dans le message
news: 3f**********************@feed0.news.be.easynet.net ...
Also tried adding c:\Program Files\Python23 to my path...


This should work, though! Still it's advisable to install to
a path without space(s), otherwise the "idle" IDE won't work.


Try with "C\Program Files\Python23" in your path (with the quotes). Could
help you (or not :-( )


That should have read "C:\Program Files\Python23".
If it doesn't work, try

C:\Progra~1\Python23

This squiggle-path is the 8.3 notation.
--Irmen

Jul 18 '05 #4
> I generally avoid installing in
c:\Program<abominable_space>Files\anything.

c:\progra~1\anything

is a non-space way of specifying the same path.

--

Dennis Reinhardt

De*****@dair.com http://www.spamai.com?ng_py
Jul 18 '05 #5
Dennis Reinhardt wrote:
I generally avoid installing in


c:\Program<abominable_space>Files\anything.


Related, but off-topic at the same time,
I've seen many programs on Windows that barf on the
default TEMP directory on Windows 2000 and XP.
That is defined as somewhere in

c:\documents and settings\username\temporary files

or something. Anyway, it contains one or more spaces.
Many -broken- tools (mostly installers!) choke on this,
that's why I always set TEMP (and TMP) to "C:\temp"
as soon as I get my hands on a 'clean' Win2000/Xp box...
(yup, get rid of the per-user-tempdir).

Bah. ;-)

spaces-in-paths-are-evilly-y'rs, Irmen de Jong

Jul 18 '05 #6
ho********@hotmail.com (hokiegal99) wrote in message news:<93**************************@posting.google. com>...
I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
computer. When I write a Python script and run it from the command
prompt, I get the following error:

C:\>python 'name-of-script.py'
'python' is not recognized as an internal or external command,
operable program or batch file.

Here's what my path contains:

C:\>path
PATH=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\ Wbem;"C:\Program
Files\Norton
SystemWorks\Norton Ghost\";C:\Program Files\SSH Communications
Security\SSH Secu
re Shell

Any ideas? I've reinstalled and rebooted several times. Also tried
adding c:\Program Files\Python23 to my path... still get the error.

Just a thought, but the SUBST command still works in Win2K.

C:\>subst /?
Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]

Substitute drive letter "P" for C:\Program Files\python23. Then, add
P:\ to your path.

Benefits? No nasty spaces, a much shorter path, and quick access to
the Python directory when you're at the command line (just type "P:").

(To be fair, assigning P: to c:\Program Files, and adding P:\python23
to your path, is probably an idea with more mileage in it.)

I haven't used this specifically myself (I install python in
c:\python##), but I have often SUBST'd the drive letter S: for
\python##\lib\site-packages when I'm studying the code of a
recently-installed package. Much easier to pop open an editor window,
or a Explorer window, to "S:\somepackage" than its longer counterpart.

It might be quite fun to go SUBST-happy and transform all those lonely
unassigned drive letters into contributing members of society. Perhaps
U: could map to c:\Documents and Settings, W: could map to %WINDIR%,
X: to the folder where you hide your illicitly-gained MP3's...

It would be best to do the SUBST before login or service startup. I
*think* you can still use an autoexec.bat file in Win2K, but there's a
formal "startup script" approach that is blessed by Microsoft. Search
MS support for "How to Run a Batch File Before Logging on to Your
Computer".

Hope it helps.

-- Graham
Jul 18 '05 #7
Peter Hansen <pe***@engcorp.com> wrote in
news:3F***************@engcorp.com:
Generally, for something like "Secure Shell", I find it much
easier just to write a little batch file that knows the full
path. Put these batch files in a directory called c:\bin
or c:\utils or something and add *that* to your path. Then
you can avoid excessive PATH creepage...


Alternatively create doskey macros for commands like that then you just
need one file with a load of macro definitions.

--
Duncan Booth du****@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
Jul 18 '05 #8
Peter Hansen <pe***@engcorp.com> wrote in
news:3F***************@engcorp.com:
Alternatively create doskey macros for commands like that then you just
need one file with a load of macro definitions.


Does that let you execute them from other batch files? I
have a few dozen utilities which run Python scripts by executing
"call python scriptname.py" somewhere, relying on a .bat file
in the PATH. Does the DOSKEY approach work similarly?


No, DOSKEY just affects what you type, you would have to write the commands
out in full in a batch file.

If you are running a lot of Python scripts from the command prompt or batch
files, consider adding .py to the PATHEXT environment variable, that will
let you run scripts directly, e.g. "scriptname" instead of "python
scriptname.py", and will search PATH for the scripts. (However be aware
that redirecting doesn't work on most versions of windows for scripts
invoked this way!)

--
Duncan Booth du****@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
Jul 18 '05 #9

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

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
9
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
2
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure...
4
by: python | last post by:
Bad file names, i.e. filenames the OS considers illegal, will cause functions in the os.path module to raise an error. Example: import os.path print os.path.getsize( 'c:/pytest/*.py' ) On...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
6
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.