How to install this wheel?

巧了我就是萌 提交于 2019-11-27 07:07:18

问题


I managed to install pip but when I use pip to install the downloaded wheel, it prints:

C:\Python34\Scripts\pip install pygame-1.9.2a0-cp34-none-win_amd64.whl
Requirement 'pygame-1.9.2a0-cp34-none-win_amd64.whl' looks like a filename, but the file does not exist
pygame-1.9.2a0-cp34-none-win_amd64.whl is not a supported wheel on this platform

The file is in the same folder (Scripts) with pip.

I did try to use the wheel tool too:

C:\Python34\Scripts\wheel install pygame-1.9.2a0-cp34-none-win_amd64.whl
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 358, in main
    args.func(args)
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 301, in install_f
    args.wheel_dirs, args.force, args.list_files)
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 202, in install
    raise WheelError("No such wheel file: {}".format(req))
wheel.tool.WheelError: No such wheel file: pygame-1.9.2a0-cp34-none-win_amd64.whl
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\wheel.exe\__main__.py", line 9, in <module>
  File "C:\Python34\lib\site-packages\wheel\tool\__init__.py", line 361, in main
    sys.stderr.write(e.message + "\n")
AttributeError: 'WheelError' object has no attribute 'message'

I use PowerShell, please help!


回答1:


Use pip to install wheel files using the full path:

C:\Python34\Scripts\pip install C:\Python34\Scripts\pygame-1.9.2a0-cp34-none-win_amd64.whl

Without the path the name is seen as a requirement rather than a already-downloaded file. This should work for wheel files that support your current Python architecture. You can verify your architecture with:

C:\Python34\python.exe -c "import distutils.util; print(distutils.util.get_platform())"

This should print win_amd6. If it prints win32 instead, you have a 32-bit Python binary and need to pick a different wheel.




回答2:


pip install pygame-1.9.2a0-cp27-none-win_amd64.whl

this worked on my computer with Python2.7.3(64bit) while other versions not worked.




回答3:


Install wheel support for pip:

pip install wheel

Install the downloaded wheel:

pip install path/to/pygame-1.9.2a0-cp34-none-win_amd64.whl



回答4:


I had to remove the 64bit python and install the 32bit version to solve this issue.

c:\python34\scripts\pip install c:\users\USER\downloads\pygame-1.9.2a0-cp34-none-win32.whl
Unpacking c:\users\USER\downloads\pygame-1.9.2a0-cp34-none-win32.whl
Installing collected packages: pygame
Successfully installed pygame
Cleaning up...

Worked fine with 32bit :)




回答5:


i tried a different version using 64 bit anaconda and it works fine

pip install pygame-1.9.2a0-cp35-none-win_amd64.whl

cp35 works a charm.



来源:https://stackoverflow.com/questions/28150738/how-to-install-this-wheel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!