This is a really annoying problem. I've prowled the web for solutions, but all I found was tips about changing the PATH variable, which I did, of course. My Python install directory is C:\Python27. It' a 32 bit version. Whenever I type python in the command prompt, it says that it isn't recognised as an internal or external command. Currently, my PATH variable is set to C:\Python27;C:\Python27\Lib\site-packages\;C:\Python27\Scripts. Anyone has any ideas? I run Windows 7 by the way (64 bit). I'm pretty desperate. Heck, if nothing works I guess I'll try dual-booting Linux and Windows 7...
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
This is only a partial answer, but I found (repeatedly) that I'd have similar issues when I would use the gui installer and not go through the custom setup.
Using the custom setup option, then using the same settings, the "install for all users" (that then installs to C://python.version/blah instead of the user based default structure) WOULD allow the installer to setup PATH correctly.
Just adding the Python path and trying again worked for me (without reboot).
MS-dos command for Python 2.7:
MS-dos command for Python 3.3:
(check if that is the folder where you installed Python).
Quick fix: May not be the most elegant or long term fix but if you are really frustrated and just want to get it to run, just copy paste the python.exe file to your current directory. This worked for me.
After adding the python folder to the system PATH variable, you should reboot your computer.
Another simple solution is: create a shortcut of the
python.exe
executable (probably it is inC:\Python27\python.exe
, or similar) in a place likeC:\Windows\system32
(that is, a place that already is listed in the PATH variable). The name of your shortcut should bepython
(maybepython.exe
should work too). I mean, it can't bepython - shortcut
or similar, for your purposes.To see the contents of the PATH variable, go to the cmd and enter
set PATH
.After changing the PATH variable in windows, you need to reboot your system before it takes effect.
Edit: As stated by @tdelaney, only a restart of cmd.exe should be required. This is true atleast for Windows 7 64bit.
In your PATH have you got a leading space before your Python path?
For example:
If you have a leading space between path's
"ry\bin; C:\Pyt"
, it won't work and is usually the cause for this type of issue.