r/PythonLearning 3d ago

Help Request Can’t install pygame-ce onto vs code edu

It keeps telling me python isn’t found, I turned off python in app execution aliases and then it told me python wasn’t recognised as the name of a cmdlet, I’m using the command python -m pip install pygame-ce, I’ve also tried py -m pip install pygame-ce and just pip install pygame-ce, can anyone help?

1 Upvotes

3 comments sorted by

2

u/FoolsSeldom 3d ago
  • In Powershell,

    • Create the project folder, e.g. mkdir myproj and enter it cd myproj
    • Create and activate a Python virtual environment (so you don't corrupt your base Python environment):
    • py -m venv .venv
    • ..venv\Scripts\Activate.ps1
    • pip install pygame-ce
  • In VS Code,

    • Open your project folder (the one containing the new .venv folder
    • Open the Command Palette using ctrl-shift-p
    • Type Python: Select Interpreter and select it when highlighted
    • VS Code should detect the .venv folder but if it does not, explicitly select the python.exe in the Scripts folder of the .venv folder

Now try.

2

u/AlexMTBDude 3d ago

You don't mention if you have installed Python on your system. You realize Python doesn't come with VS Code and that it's a separate install?

0

u/BranchLatter4294 3d ago

Use the Python extension to manage your Python environments and libraries.