rattail-manual/docs/base/install/windows/python.rst

118 lines
3.9 KiB
ReStructuredText
Raw Normal View History

========
Python
========
You will need Python in order to use any Rattail software on Windows.
You can get it from: `<https://www.python.org/downloads/windows/>`_
The notes below should help you decide which version to install etc.
Which Version?
--------------
In general you are encouraged to use the "latest stable" version of
Python unless you have a reason to be more conservative.
As of this writing Python 3.10 is the "latest" but has not yet been
tested in production, so it is suggested to use 3.9 instead, since
that has been tested. That is the situation "today" (Oct 2021) and
eventually should change.
Any other Python-based packages you may need to install, must of
course be compatible with the version of Python you have. This
includes Rattail itself (see :doc:`rattail`) but also e.g. the pywin32
library (see :doc:`pywin32`) and perhaps wxPython. You may want to
gather your download links ahead of time to be sure they all are for
the same Python version.
Note that in general, e.g. if you only need the Rattail File Monitor,
then you will not likely need to "upgrade" Python anytime soon. If
you install 3.9 for instance then it should continue to work fine for
the forseeable future.
32 bit vs. 64 bit
-----------------
In some cases, your Rattail app(s) may need to load and invoke code
from various compiled libraries. The most common scenario is that the
app needs to read data from an ODBC connection which uses a binary
driver.
Sometimes these libraries are only available in a 32 bit version. If
this is the case for you then you must install 32 bit Python, even on
a 64 bit machine.
Again you may want to gather all download links ahead of time to be
sure everything matches, for both Python version and "bitness".
.. note::
The above statements "used to be true" but it's been a while since
I had my head in that game, and much may have changed.
In particular if you only need the Rattail File Monitor, and only
need it to do standard tasks like moving files to a Linux server,
then there should be no binary libraries involved and you will be
fine to use 64bit Python.
Installation
------------
Download the appropriate installer from
`<https://www.python.org/downloads/windows/>`_
Right-click the installer file and choose "Run as administrator" to
launch it.
If you are wanting to use the Rattail File Monitor then you should
install Python "for all users" - this requires that you "customize"
the installation. In other words don't just click "Install Now" but
instead click "Customize" and then select the option to install for
all users.
You should also see an option to "Add Python to your PATH variable" -
it is recommended that you choose this unless you have a reason not
to.
.. _python-sanity-check:
Sanity Check
------------
Once the installation completes, you should open a *new* console
(``cmd.exe``) and confirm that ``python.exe`` is usable:
.. code-block:: none
C:\>python --version
Python 3.9.7
If that doesn't work then it is probably due to one of 2 things:
If your console window was already open during the install, please close
it and re-open, then it should work.
Or, if still no good, then you probably did not add Python to your
PATH variable during the install. You can of course re-install, but
you can also manually add it to PATH if you prefer.
If you want to manually add Python to PATH then see e.g. `this
article`_ for instructions. You will need to add 2 folders to the
variable, paths of which may vary per your install. If you installed
"for all users" as described above then the folders are probably
something like:
* ``C:\Program Files\Python39``
* ``C:\Program Files\Python39\Scripts``
.. _this article: http://www.computerhope.com/issues/ch000549.htm
If PATH looks good and you re-opened your console, and things still do
not work, then please file a bug report at
https://redmine.rattailproject.org/