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
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%?
> I'm new to python, i downloaded version 2.5
What exactly did you download? Give us the URL to the file if possible.
> opened windows (vista) command line and wrote "python"
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
>
> 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
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
thanks guyz for the nice info
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???
Ok, it's not killing me anymore :P
I uninstalled python and reinstalled it again, and now it's working
>
> 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
I am curious, what's the difference ?
And does this work if you want to add it to your user PATH (not the
system one) ?
David
My way doesn't add the dlls to the search path. It allows you to have
multiple python commands at once, too. I have shortcuts for python24,
python25 and python26 on my Windows box.
Christian
>
> My way doesn't add the dlls to the search path. It allows you to have
> multiple python commands at once, too. I have shortcuts for python24,
> python25 and python26 on my Windows box.
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
Christian,
at last i made the bat file (python25.bat) that contains the following
contents:
---
@C:\Python25\python.exe %*
---
could you tell me how to call python25 in the batch files? what batch
files do you mean? where do i find them?
"python25.bat" or "python25.cmd" are acceptable names for that file.
Assuming you have a command window, if you enter the command,
C:\WhereEver> echo %path%
you will see a semicolon-separated list of directories. Put the
file in any of the directories on that list. You should then be
able to use the command:
C:\WhereEver> python25 <whatever>
Personally, I would use the name "python25.cmd", but that may just be
superstition on my part about the difference between .bat and .cmd
files.
--Scott David Daniels
Scott....@Acm.Org
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