You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/installation.rst
+37-21Lines changed: 37 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,21 @@
2
2
3
3
Installation
4
4
============
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.
7
6
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.
9
9
These instructions include installing Python if you don't have it yet.
10
10
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
-
14
11
Windows
15
12
-------
16
-
`First install a recent version of Python 3.
13
+
`First install the latest recent version of Python 3.
17
14
<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.
19
20
20
21
If you don't already have it, then install the latest
21
22
`Microsoft Visual C++ Redistributable
@@ -24,13 +25,37 @@ If you don't already have it, then install the latest
24
25
for a 64-bit install. You'll need to keep this in mind when distributing any
25
26
libtcod program to end-users.
26
27
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
28
35
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
30
45
31
46
If Python was installed for all users then you may need to add the ``--user``
32
47
flag to pip.
33
48
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
+
34
59
MacOS
35
60
-----
36
61
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`.
68
93
Open this tab and you should see a prompt with ``(venv)`` on it.
69
94
This means your commands will run in the virtual environment of your project.
70
95
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::
81
97
82
98
pip install tcod
83
99
84
100
You can now use ``import tcod``.
85
101
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
87
103
the tcod version in a `requirements.txt file <https://pip.pypa.io/en/stable/user_guide/#requirements-files>`_.
88
104
PyCharm will automatically update the virtual environment from these files.
0 commit comments