0

I'd like to install pygame on the newest python 3.11.0 version: if i use pip command it just keeps telling me that pygame is already installed... that is true because it is on python 3.10.8, but I want to install it on 3.11.0 too... How to install it also in the other version? Thanks ;)

I tried some suggestions found on internet but any of those worked

Cesco
  • 5
  • 1
  • 1
    Use `py -3.11 -m pip install xxx`, or go to your python 3.11 directory and `python -m pip install xxx` – thedemons Nov 05 '22 at 15:31
  • 1
    To add to what @thedemons said, if you want to install `pygame` on 3.11 you will need to use `... pip install pygame --pre`, see this answer: https://stackoverflow.com/questions/74188013/python-pygame-not-installing – Matiiss Nov 06 '22 at 01:26

1 Answers1

0

Type out the full path to the 3.11 binary and use pip as a python module for that python binary, for example:

C:\some\path\to\python311\python.exe -m pip install pygame

The more complicated method, but definitely the more recommended way if you are using multiple different versions often and you wish to switch back and forth at will, is to use something like Miniconda to manage your environments.

Birb
  • 866
  • 10
  • 23
  • Is it a problem having pygame installed on both versions? If I install it on one will pygame on the other version be uninstalled? – Cesco Nov 05 '22 at 23:14
  • @Cesco no, but you will need to use `... pip install pygame --pre` for now with 3.11 – Matiiss Nov 06 '22 at 01:25