You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在IPython中安装pygame包失败,提示pip未识别怎么办?

Hey there! That error pops up because your system can't locate the pip executable in its PATH. No worries—here are a few straightforward fixes tailored to your Windows 10 + Python 3.6.1 setup:

  • Quickest reliable fix: Skip the PATH issue entirely by running pip through your current Python environment. In IPython, execute this command:

    !python -m pip install pygame
    

    This works because it uses the Python interpreter you’re already using in IPython to find the pip tool directly, so you don’t need to mess with system settings right away.

  • If the above fails, use the full path to pip:
    By default, Python 3.6 installs to C:\Python36\, and pip lives in the Scripts subfolder. Run this full path in IPython:

    !C:\Python36\Scripts\pip install pygame
    

    If you installed Python for your user only (not system-wide), the path might look like C:\Users\YourUsername\AppData\Local\Programs\Python\Python36\Scripts\pip.exe—just replace YourUsername with your actual Windows username.

  • Permanent fix: Add pip to your system PATH:

    1. Right-click the Start menu, select "System", then click "Advanced system settings" on the left.
    2. In the System Properties window, go to the "Advanced" tab and click "Environment Variables".
    3. Under "System variables", find the Path variable, select it, and click "Edit".
    4. Click "New" and add the path to your Python Scripts folder (e.g., C:\Python36\Scripts\).
    5. Save all changes by clicking "OK" in every window, then restart IPython (or your terminal) and try !pip install pygame again.

Any of these methods should get pygame installed successfully!

内容的提问来源于stack exchange,提问作者Andres Cook

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:12:28