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: README.rst
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,10 +30,49 @@ New contributors are welcome!
30
30
Installation
31
31
------------
32
32
33
+
To install pygame-ce, first make sure you have Python (and pip) installed and available on your PATH.
34
+
Then, run the following command in your terminal or command prompt:
35
+
33
36
::
34
37
35
38
pip install pygame-ce
36
39
40
+
Note that on some platforms you may need to use ``pip3`` instead of ``pip``.
41
+
42
+
Linux Note: "Breaking System Packages" Error
43
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
+
45
+
On some Linux distributions (like Ubuntu or Debian), installing Python packages with ``pip`` can trigger a message like the following:
46
+
47
+
::
48
+
49
+
error: externally-managed-environment
50
+
This environment is externally managed when system packages are installed.
51
+
52
+
This means your system Python is managed by the OS, and using ``pip3`` globally might interfere with system packages.
53
+
54
+
Recommended Solutions
55
+
^^^^^^^^^^^^^^^^^^^^^
56
+
57
+
1. Use ``venv`` (Virtual Environment):
58
+
59
+
You can create a virtual environment and install pygame-ce within it.
60
+
This way you still use system Python but create a separate environment for installed packages so that they do not conflict with or break system ones.
61
+
62
+
.. code-block:: bash
63
+
64
+
python3 -m venv venv # create a venv named 'venv'
65
+
source venv/bin/activate # activate venv
66
+
pip install pygame-ce # install packages in venv
67
+
68
+
2. Use ``pyenv`` (User-level Python management):
69
+
70
+
`pyenv <https://github.com/pyenv/pyenv>`_ lets you install and manage your own Python versions at the user level without touching the system one.
71
+
As a plus, you can install and use multiple Python versions side by side.
72
+
73
+
3. Use ``uv`` (Fast Modern Package Installer):
74
+
75
+
`uv <https://docs.astral.sh/uv/>`_ is a modern, fast Python package and environment manager that can serve as a replacement for both ``venv`` and ``pyenv``.
0 commit comments