python3.5安装pygame_如何通过pip为Python 3.5安装Pygame?

1586010002-jmsa.png

I'm trying to install Pygame for python 3.5 32bit. I have learned that I can open the .whl files provided on the site by using the pip command. The problem is I've tried multiple ways doing this but with constant error.

python -m pip install pygame-1.9.2a0-cp35-none-win32.whl

'python' is not recognized as an internal or external command,

operable program or batch file.

The file I'm trying to install: pygame-1.9.2a0-cp35-none-win32.whl

My python program is located in my programs folder and everything else works fine.

解决方案

You need to add python.exe to your Windows PATH variable.

The is the system variable that the operating system uses to locate the needed executables from the command line or Terminal windows. [1]

Actually there are many methods to set the PATH variable on windows. One way is to type

set PATH=%PATH%;location path of Python.exe

into the windows command-line interpreter (cmd):

set PATH=%PATH%;C:\Python35-32

Now -- before running the pip command -- you need to make sure that either

your working directory is set to the same folder where your pygame-1. ... in32.whl file is located

or

you supply the full absolute or relative path to the pip command.

Now you should be able to run your python -m pip command after restarting the cmd.exe.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值