How to install this wheel?

37,671

Solution 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.

Solution 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.

Solution 3

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 :)

Solution 4

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
Share:
37,671
DedSecz
Author by

DedSecz

Self-made 15 y/o developer, loves spaghetti and Python. Mostly Spaghetti.

Updated on January 16, 2020

Comments

  • DedSecz
    DedSecz over 4 years

    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!

  • DedSecz
    DedSecz over 9 years
    Yes I use Python 3.4.2 I think, 3.4 in general, 64-bit version and about if it is bound or not, i think it is P.S I used C:\Python34\Scripts> .\pip install -f --trusted-host lfd.uci.edu/~gohlke/pythonlibs pygame but it printed an error at the unpacking part
  • DedSecz
    DedSecz over 9 years
    Collecting lfd.uci.edu/~gohlke/pythonlibs Downloading lfd.uci.edu/~gohlke/pythonlibs (1.0MB) 100% |################################| 1.0MB 2.6MB/s ta 0:00:01 Cannot unpack file C:\Users\Ded\AppData\Local\Temp\pip-prlwv8rf-unpack\pythonli‌​bs (downloaded from C:\Users\Ded\AppDat a\Local\Temp\pip-nviu9vhg-build, content-type: text/html; charset=utf-8); cannot detect archive format Cannot determine archive format of C:\Users\Ded\AppData\Local\Temp\pip-nviu9vhg-build
  • Martijn Pieters
    Martijn Pieters over 9 years
    Why did you use --trusted-host in between the -f switch and the URL?
  • DedSecz
    DedSecz over 9 years
    Because otherwise it doesnt let me start the download :/
  • Martijn Pieters
    Martijn Pieters over 9 years
    They clearly already have wheel support installed as that's part of the traceback of the second attempt.
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: the --trusted-host argument is a separate switch: pip install --trusted-host www.lfd.uci.edu -f http://www.lfd.uci.edu/~gohlke/pythonlibs/ pygame.
  • DedSecz
    DedSecz over 9 years
    @Martjin Pieters Look at this, I am confused :\ : dropbox.com/s/wmdvngw8l6f1qa1/…
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: the command is either .\pip or C:\Python34\Scripts\pip, not something with spaces in between. :-)
  • DedSecz
    DedSecz over 9 years
    @Martjin Pieters, well yes, but "this wheel is not supported on this platform?" what?
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: what does C:\Python34\Scripts\python -c 'import distutils.util; print(distutils.util.get_platform())' print?
  • DedSecz
    DedSecz over 9 years
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: That's because the command python is not found. I gave you a different command however, use C:\Python34\Scripts\python.
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: by the way, you don't need to use my name in the comment, since this is my answer post I get notified anyway. That way you don't have to worry about how to spell my name either. I see you also used the command from my comment but had left a cd on the line, so that broke.
  • DedSecz
    DedSecz over 9 years
    I am sorry but I dont get what u mean, I did write C:\.. python on powershell without doing any cds, just opened it and still same thing, look: dropbox.com/s/0l26qomqk5nmyne/…
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: ah, I see I got the path to your Python interpreter wrong. Does python.exe work?
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: next attempt: C:\Python3.4\python -c 'import distutils.util; print(distutils.util.get_platform())'
  • DedSecz
    DedSecz over 9 years
    python.exe doesnt work, but if I go a subdirectory above (remove Scripts) it works like a charm, let me test the last line you sent me. EDIT: I used the line u sent me and it worked great, it printed "win32"
  • Martijn Pieters
    Martijn Pieters over 9 years
    @DedSecz: then you have a Python 32-bits installation, not a 64-bit. You'll need to pick the correct wheel accordingly.
  • DedSecz
    DedSecz over 9 years
    Oh damn.. good point, I am so dumb. Now I noticed it is 32 bit. I thought it was 64bit though haha, thanks a lot, let me try the 32-bit pygame and update u with results
  • DedSecz
    DedSecz over 9 years
    It worked like a charm! Package successfully installed! Thanks a lot Martijn!
  • Simeon Visser
    Simeon Visser over 9 years
    There might be a bug in pip (or somewhere else) as similar things are happening to others: stackoverflow.com/questions/28107123/… (64-bits not being detected)
  • Martijn Pieters
    Martijn Pieters over 9 years
    @SimeonVisser: this isn't a 64-bit Python install.
  • Martijn Pieters
    Martijn Pieters over 9 years
    @SimeonVisser: remember that you can install a 32-bit Python executable on a 64-bit Windows machine.
  • Simeon Visser
    Simeon Visser over 9 years
    @MartijnPieters: the bug is that for 32-bit interpreter on 64-bit OS it would report "win32" on Windows but not on other platforms - hence if it reports "win32" that doesn't mean it can't install a 64-bit wheel, it's only a bug in deciding whether the wheel can be installed.
  • Martijn Pieters
    Martijn Pieters over 9 years
    @SimeonVisser: yeah, I haven't seen that happen yet though. So far I only have had people with 32-bit Python installations (on 64-bit windows) and / or using the wrong pip (pip -V shows that they are using a different Python version).