Add Installation-Windows-Python

Lance Edgar 2025-02-16 00:07:32 -06:00
parent 7702371cce
commit 47dd0ab61c

@ -0,0 +1,43 @@
# Installing Python on Windows
**NOTE:** *This document is deprecated. Please see the [[https://rattailproject.org/docs/rattail-manual/base/install/windows/index.html|Rattail Manual]] instead.*
There are surely lots of ways to install Python on Windows, and these steps are not necessarily "superior" to other methods, if you know what you're doing. But they do have the benefit of being relatively well-tested in production environments.
## 32 bit vs. 64 bit
In certain cases the Python interpreter may need to load and invoke code from various compiled libraries. Sometimes these libraries are only available in a 32 bit version. This issue may or may not come up in your individual situation, but as a rule ''only'' 32 bit Python is recommended, even on 64 bit machines.
## Python
First of course you'll need Python itself, available at [[https://www.python.org/downloads/windows/]].
The only well-supported version is Python 2.7. Certainly Python 3.x is ''not'' (yet) supported. Again, you are encouraged to stick with 32 bit Python even if running a 64 bit machine.
Download the appropriate installer and run it. Make sure that during the wizard step titled "Customize Python 2.7.x" you change the "Add python.exe to Path" setting (bottom of the list) to "Will be installed on local hard drive". All other defaults are fine.
At this point you should be able to open a (new!) command line and confirm `python.exe` is usable:
```
C:\>python --version
Python 2.7.10
```
If that doesn't work, you may need to manually add `C:\Python27;C:\Python27\Scripts` to your [[http://www.computerhope.com/issues/ch000549.htm|PATH environment variable]].
## Python for Windows Extensions
The situation on Windows is a little more complicated, and the short version is that you must also install Mark Hammond's "Python for Windows Extensions" package, available at [[https://github.com/mhammond/pywin32/releases]].
The specific version you download should match the version of Python you installed, above. Again the recommendation is Python 2.7, 32 bit. Run the installer; all defaults are fine.
## Pip
If you just downloaded a fresh copy of Python (above), then you should already have a copy of pip. If you are working with an older install of Python etc. it is possible that you may not yet have pip. Open a command line to find out:
```
C:\>pip --version
pip 7.0.1 from C:\Python27\lib\site-packages (python 2.7)
```
If that doesn't work (but `python --version` does) then you probably need to install pip. The recommended method is via the `get-pip.py` script according to [[https://pip.pypa.io/en/latest/installing.html#install-pip|these instructions]].