Home > Blockchain >  Can't install pygame, returning "Requirement already satisfied: pygame in ./Library/Python
Can't install pygame, returning "Requirement already satisfied: pygame in ./Library/Python

Time:01-16

I'm on mac and I'm using pip3 install pygame and it keeps responding with Requirement already satisfied: pygame in ./Library/Python/3.10/lib/python/site-packages (2.1.1) Does this mean that I already have pygame installed? Because when I do import pygame in my script it returns the following error. ModuleNotFoundError: No module named 'pygame'

CodePudding user response:

It's possible that you are working with a different interpreter and pygame is installed in different environment. So try changing it

So, if you are on vscode

  1. ctrl shift p
  2. Type Python: Select Interpreter
  3. change it to desired version where requirement is satisfied

CodePudding user response:

yes it means you have already installed pygame. I had this error and found that uninstalling pygame (probably 'pip3 uninstall pygame' but I am not on mac os so i can't test it) and reinstalling it fixed it.

CodePudding user response:

This is similar to a question asked you may have installed it for the wrong version of python or you are using an old python version in your IDE that does not have the package installed so what you have to do is to check the version of python you are installing the package to, you can do that in CMD, just type python and press enter and it will show you the version of python you are installing the package to, and if this does not work check your IDE and look for which version of python you are running you may be running an older version, I advise you to install the package from you IDE terminal and if it still does not work try uninstalling the package and reinstalling it. There is a similar question with the answer that might help

CodePudding user response:

Make sure that, if you are using a virtual environment, you have activated it before trying to run the program.

If you don't really know if you are using a virtual environment or not, check with try to find a file with the name activate like this: find . -name activate.

CodePudding user response:

Are you using virtual environment?? if you are then make sure this installation under this virtual environment, or activate this before run

  •  Tags:  
  • Related