Comment on Can someone help me get Pygame working?
Contramuffin@lemmy.world 4 days ago
You’ll want to use a virtual environment. Once you have one set up, you can use pip to install modules. ie, you’ll want path/to/virtual/environment/bin/python pip install pygame
Then, you can run programs through the virtual environment with the same method. ie, path/to/virtual/environment/bin/python path/to/game.py
ComicalMayhem@lemmy.world 4 days ago
Following someone else’s suggestions, I made a venv file called venv and installed pygame in it using
venv/bin/pip install pygamefrom the directory where I have the main project in. Interestingly, it installed just fine, but when I try to dopip install pygamewhile in the virtual environment’s bin folder, I get theexternally managed environmenterror. My venv folder doesn’t have an environment folder, it’s just~/path-to/venv, where venv is the name of the virtual environment. probably should have picked a different name tbh. Anyways I followed your suggestion making replacements where necessary to run the program. Dunno if I’m doing something wrong but it isn’t working for me.Contramuffin@lemmy.world 4 days ago
It’s not just about being in the right folder. You need to specify the path. If you just do
python file.pyorpip install whateverIt will try to use system components, regardless of what folder you’re in. You’ll need to explicitly say, “use this specific venv version of python.” If you’re in the bin folder of the venv, you’ll need to use
./python file.py