Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
163 views
in Technique[技术] by (71.8m points)

python - How to install this wheel?

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

C:Python34Scriptspip 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:Python34Scriptswheel install pygame-1.9.2a0-cp34-none-win_amd64.whl
Traceback (most recent call last):
  File "C:Python34libsite-packageswheelool\__init__.py", line 358, in main
    args.func(args)
  File "C:Python34libsite-packageswheelool\__init__.py", line 301, in install_f
    args.wheel_dirs, args.force, args.list_files)
  File "C:Python34libsite-packageswheelool\__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:Python34lib
unpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:Python34lib
unpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:Python34Scriptswheel.exe\__main__.py", line 9, in <module>
  File "C:Python34libsite-packageswheelool\__init__.py", line 361, in main
    sys.stderr.write(e.message + "
")
AttributeError: 'WheelError' object has no attribute 'message'

I use PowerShell, please help!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use pip to install wheel files using the full path:

C:Python34Scriptspip install C:Python34Scriptspygame-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:Python34python.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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...