python command not working

8

83nini

Hi guys,

I'm new to python, i downloaded version 2.5, opened windows (vista)
command line and wrote "python", this should take me to the python
command line, but it did not! i'm getting : python is not an internal
command, external command, program, or command file.

anybody has a clue how do i solve this?
thanks in advance,
cheers,
Lina
 
D

David Cournapeau

Hi guys,

I'm new to python, i downloaded version 2.5, opened windows (vista)
command line and wrote "python", this should take me to the python
command line, but it did not! i'm getting : python is not an internal
command, external command, program, or command file.

The installer does not add the path of python into your %PATH%
variable, You have to do it manually or call the full command path
(C:\Python25\python.exe or something)

David
 
8

83nini

The installer does not add the path of python into your %PATH%
variable, You have to do it manually or call the full command path
(C:\Python25\python.exe or something)

David

thanks for the tip, how do i add the path of python into my %PATH%?
 
8

83nini

What exactly did you download? Give us the URL to the file if possible.


The Python interpreter and libraries, like any other application, needs
to be installed into your system before you can start using it properly.
If you only downloaded it, then it's just bits in a file, nothing more.
Did you run the installer?

--
 \             “If you're not part of the solution, you're part of the |
  `\                                      precipitate.” —Steven Wright |
_o__)                                                                  |
Ben Finney

yes i did
 
D

David Cournapeau

thanks for the tip, how do i add the path of python into my %PATH%?
From the command line (and from memory, I don't use windows regularly):

set PATH=C:\python25;%PATH%

And you can set it up permanently in the advanced settings panel of
windows (the one where you set up things like amount of swap,
restoration and the likes, I don't know the exact name in English)

David
 
8

83nini

set PATH=C:\python25;%PATH%

And you can set it up permanently in the advanced settings panel of
windows (the one where you set up things like amount of swap,
restoration and the likes, I don't know the exact name in English)

David

thanks David, the PATH=C:\python25;%PATH% worked, but i still don't
know how to do it perminantly
 
T

Tim Golden

83nini said:
thanks David, the PATH=C:\python25;%PATH% worked, but i still don't
know how to do it perminantly

Well you can do by selecting [System] from the Control Panel,
selecting the [Advanced] tab, the [Environment Variables]
button and then finding the PATH (user or system) and editing
it in the agonisingly small edit control which doesn't seem
to have changed since Windows 3.1. (He says, exaggerating only
a little)...

.... or, I was going to say, you could run Christian Heimes'
win_add2path.py script which is in c:\python26\lib\tools.
Except that it wasn't added until python26 and uses
_winreg.ExpandEnvironmentStrings which also wasn't added
until then. (I think). But for anyone else still watching
the show...

TJG
 
8

83nini

thanks David, the PATH=C:\python25;%PATH% worked, but i still don't
know how to do it perminantly

Well you can do by selecting [System] from the Control Panel,
selecting the [Advanced] tab, the [Environment Variables]
button and then finding the PATH (user or system) and editing
it in the agonisingly small edit control which doesn't seem
to have changed since Windows 3.1. (He says, exaggerating only
a little)...

... or, I was going to say, you could run Christian Heimes'
win_add2path.py script which is in c:\python26\lib\tools.
Except that it wasn't added until python26 and uses
_winreg.ExpandEnvironmentStrings which also wasn't added
until then. (I think). But for anyone else still watching
the show...

TJG- Dölj citerad text -

- Visa citerad text -

thanks guyz for the nice info
 
8

83nini

I highly recommend against adding C:\Python25 to your %PATH%. You can
get the same effect by adding a simple bat file to C:\Windows\System32

---
@C:\Python25\python.exe %*
---

Call it python25.bat and you are done. Apropos call, don't forget to
"call python25" in batch files. :)

Christian

THIS IS REALLY KILLING ME!!!
i've been trying everything you adviced me to do, none works!!!
all i want to do is to type "python" in the cmd and get the python
command line
i want to run a server writing "python manage.py runserver" that is
not working either, of course cos "python" command is not working.
is this one of the stupid things that vista causes? or what???
 
8

83nini

THIS IS REALLY KILLING ME!!!
i've been trying everything you adviced me to do, none works!!!
all i want to do is to type "python" in the cmd and get the python
command line
i want to run a server writing "python manage.py runserver" that is
not working either, of course cos "python" command is not working.
is this one of the stupid things that vista causes? or what???- Dölj citerad text -

- Visa citerad text -

Ok, it's not killing me anymore :p
I uninstalled python and reinstalled it again, and now it's working
 
8

83nini

Ah, thanks, that's really useful. I need this too, and did it the
"unix" way, which did not work so well for various reasons. This is
much better,

David

Excuse me guys, could you please help me and tell me step by step how
to make the bat file that Christian is talking about and save it in
the System32?

I'm trying to save anything there but it's not working, though i'm the
administrator, vista keeps telling me that i can't save anything to
the system32 folder and that i have to contact my admin. in order to
fix it!

thanks for the help.
cheers,
Lina
 
8

83nini

Excuse me guys, could you please help me and tell me step by step how
to make the bat file that Christian is talking about and save it in
the System32?

I'm trying to save anything there but it's not working, though i'm the
administrator, vista keeps telling me that i can't save anything to
the system32 folder and that i have to contact my admin. in order to
fix it!

thanks for the help.
cheers,
Lina

Christian,
at last i made the bat file (python25.bat) that contains the following
contents:
 
D

Dave Angel

83nini said:
Christian,
at last i made the bat file (python25.bat) that contains the following
contents:
Your original question was how to get an interactive interpreter from a
command prompt. There are at least 3 ways:

1) just specify the full path to the executable on the command line
e:\mysource\> c:\python25\python.exe

2) add c:\python25 to your PATH, either by using the SET statement, or
control panel.
then you'll be able to just use:
e:\mysource\> python

3) create a batch file in a directory on your PATH

#3 is probably the best way. You've created that batch file, now just
use it.
e:\mysource\> python25

The remark about using "call python25" refers only to the case where you
write additional batch files that use this one. Since you're not likely
to, don't worry about it yet.


If typing python25 in a command box doesn't work, then you don't have
that file on the PATH. If that's the case, tell us exactly where the
file is.
 
8

83nini

Your original question was how to get an interactive interpreter from a
command prompt.  There are at least 3 ways:

1) just specify the full path to the executable on the command line
     e:\mysource\>  c:\python25\python.exe

2) add c:\python25  to your PATH, either by using the SET statement, or
control panel.
     then you'll be able to just use:
     e:\mysource\>  python

3) create a batch file in a directory on your PATH

#3 is probably the best way.  You've created that batch file, now just
use it.
    e:\mysource\>  python25

The remark about using "call python25" refers only to the case where you
write additional batch files that use this one.  Since you're not likely
to, don't worry about it yet.

If typing python25 in a command box doesn't work, then you don't have
that file on the PATH.  If that's the case, tell us exactly where the
file is.

Thanks a million, it worked. :D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,178
Latest member
SusanaHam4

Latest Threads

Top