Skip to content

Commit c8bbe81

Browse files
committed
Update installation guide.
1 parent 6f6e3f0 commit c8bbe81

1 file changed

Lines changed: 37 additions & 21 deletions

File tree

docs/installation.rst

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22

33
Installation
44
============
5-
Once installed, you'll be able to import the `tcod` and `libtcodpy` modules,
6-
as well as the deprecated `tdl` module.
5+
Once python-tcod is installed, you'll be able to import the `tcod` module.
76

8-
Python 3.5 or above is required for a normal install.
7+
The latest version of Python 3 is recommended for a normal install.
8+
Python 2 can not be used with the latest versions of python-tcod.
99
These instructions include installing Python if you don't have it yet.
1010

11-
There are known issues in very old versions of pip.
12-
If pip fails to install python-tcod then try updating it first.
13-
1411
Windows
1512
-------
16-
`First install a recent version of Python 3.
13+
`First install the latest recent version of Python 3.
1714
<https://www.python.org/downloads/>`_
18-
Make sure Python is added to the Windows `PATH`.
15+
16+
.. important::
17+
Make sure ``Add Python to environment variables`` is checked in the installer.
18+
Otherwise Python will not be added to the Windows ``PATH``.
19+
If you forgot to do this then you can reopen the installer and *modify* your installation.
1920

2021
If you don't already have it, then install the latest
2122
`Microsoft Visual C++ Redistributable
@@ -24,13 +25,37 @@ If you don't already have it, then install the latest
2425
for a 64-bit install. You'll need to keep this in mind when distributing any
2526
libtcod program to end-users.
2627

27-
Then to install python-tcod run the following from a Windows command line::
28+
You should verify your Python install with your terminal.
29+
The terminal you use can be the Windows Command Prompt, PowerShell, GitBash, or similar.
30+
It can not be the Python interpreter (indicated with a ``>>>`` prompt.)
31+
Run the following commands (excluding the ``>``) to verify your Python installation::
32+
33+
>python -V
34+
Python 3.10.0
2835

29-
py -m pip install tcod
36+
>pip -V
37+
pip 21.2.4 from ...\Python310\lib\site-packages\pip (python 3.10)
38+
39+
The above outputs would be the result of Python 3.10 being installed.
40+
**Make sure the mentioned Python versions you get are not different than the latest version you just installed.**
41+
42+
To install python-tcod run the following from a Windows command line::
43+
44+
>pip install tcod
3045

3146
If Python was installed for all users then you may need to add the ``--user``
3247
flag to pip.
3348

49+
You can then verify that ``tcod`` is importable from the Python interpreter::
50+
51+
>python
52+
53+
>>> import tcod
54+
55+
If ``import tcod`` doesn't throw an ``ImportError`` then ``tcod`` has been installed correctly to your system libraries.
56+
57+
Some IDE's such as PyCharm will create a virtual environment which will ignore your system libraries and require tcod to be installed again in that new environment.
58+
3459
MacOS
3560
-----
3661
The latest version of python-tcod only supports MacOS 10.9 (Mavericks) or
@@ -68,22 +93,13 @@ By default the bottom bar of PyCharm will have a tab labeled `terminal`.
6893
Open this tab and you should see a prompt with ``(venv)`` on it.
6994
This means your commands will run in the virtual environment of your project.
7095

71-
With a new project and virtual environment you should upgrade pip before
72-
installing python-tcod. You can do this by running the command::
73-
74-
python -m pip install --upgrade pip
75-
76-
If this for some reason failed, you may fall back on using `easy_install`::
77-
78-
easy_install --upgrade pip
79-
80-
After pip is upgraded you can install tcod with the following command::
96+
From this terminal you can install ``tcod`` to the virtual environment with the following command::
8197

8298
pip install tcod
8399

84100
You can now use ``import tcod``.
85101

86-
If you are working with multiple people or computers then it's recommend to pin
102+
If you are working with multiple people or computers or are using a Git repository then it is recommend to pin
87103
the tcod version in a `requirements.txt file <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_.
88104
PyCharm will automatically update the virtual environment from these files.
89105

0 commit comments

Comments
 (0)