-
-
Notifications
You must be signed in to change notification settings - Fork 169
Installing pygame‐ce
How do I download Pygame on VSCode again?
- Pygame Pro
The one you probably already know
pip install pygame-ce
However, if you already have pygame
installed, you MUST uninstall it first:
pip uninstall pygame
pip install pygame-ce
Now, suppose you messed the order up or something is still not working even after you have uninstalled pygame
, you may want to ensure that your installation of pygame-ce
is not corrupted:
pip install --force-reinstall pygame-ce
If you want a more in-depth explanation/tutorial on virtual environments in Python, I'd highly suggest the videos made by Corey Schafer:
- Windows: Python Tutorial: VENV (Windows) - How to Use Virtual Environments with the Built-In venv Module
- Mac & Linux: Python Tutorial: VENV (Mac & Linux) - How to Use Virtual Environments with the Built-In venv Module
Typically when working on a project, you want to use a virtual environment, it offers several benefits, but mainly it just helps isolate your project's environment from the rest of the system or other projects.
This wouldn't be a comprehensive guide if it didn't include how to deal with virtual environments...
To create a virtual environment, the easiest way would be to simply use the built-in venv
package.
Firstly, open a terminal in your project's directory, then
python -m venv .venv
This will create a .venv
directory (your environment directory) at the current working directory (your project's root directory).
Now that you have got your virtual environment in your project's directory, you want to make sure you have activated it BEFORE performing any actions with python
or pip
:
- On Windows:
./.venv/source/activate
- On Mac & Linux:
or
. ./.venv/bin/activate
source ./.venv/bin/activate
Note
Any time you close the terminal and reopen it again, you will likely have to activate the environment again.
TODO (with images)
TODO (with images)
While installing packages in general with pip
should be pretty straight-forward, it is inevitable that there will be some that will run into various issues. We don't all use identical computers, they are not all configured the same way, so it makes sense that instructions that work for (most) other people, may not work for you. Don't feel sad about that, it is quite likely you have run into an issue that someone else has run into before you and has managed to solve, so here is a compilation of such issues.
TODO
TODO
TODO
TODO