Python安装Pygame失败求助:requests依赖缺失引发安装报错
Hey there! I see you're stuck installing Pygame for your school multiplayer game project—let's get this sorted out for you.
Looking at your error logs, the key issue jumps right out:
ModuleNotFoundError: No module named 'requests'
The development version of Pygame (2.0.0.dev6) you're trying to install needs the requests module to download prebuilt dependencies, but it's missing from your Python environment. Here's how to fix this step by step:
Step 1: Install the missing requests module
First, run this command to add requests to your Python setup:
py -m pip install requests
Step 2: Re-attempt installing Pygame
Once requests is installed, go ahead and run your original installation command again:
py -m pip install pygame==2.0.0.dev6
Bonus: Use a stable Pygame version (recommended)
Since you're working on a school project, using a stable, official release might save you from unexpected bugs. If you don't specifically need the dev version, install the latest stable build instead:
py -m pip install pygame
Extra Troubleshooting Tip
If you still run into issues, make sure your pip is up to date first—this can fix a lot of installation quirks:
py -m pip install --upgrade pip
内容的提问来源于stack exchange,提问作者Rachel Shure




