4

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!

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
DedSecz
  • 163
  • 2
  • 2
  • 6

4 Answers4

12

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.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • 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 http://www.lfd.uci.edu/~gohlke/pythonlibs/ pygame but it printed an error at the unpacking part – DedSecz Jan 26 '15 at 13:21
  • Collecting http://www.lfd.uci.edu/~gohlke/pythonlibs/ Downloading http://www.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\pythonlibs (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 – DedSecz Jan 26 '15 at 13:24
  • Why did you use `--trusted-host` in between the `-f` switch and the URL? – Martijn Pieters Jan 26 '15 at 13:24
  • Because otherwise it doesnt let me start the download :/ – DedSecz Jan 26 '15 at 13:26
  • @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`. – Martijn Pieters Jan 26 '15 at 13:28
  • @Martjin Pieters Look at this, I am confused :\ : https://www.dropbox.com/s/wmdvngw8l6f1qa1/Screenshot%202015-01-26%2015.31.04.png?dl=0 – DedSecz Jan 26 '15 at 13:32
  • @DedSecz: the command is either `.\pip` or `C:\Python34\Scripts\pip`, not something with spaces in between. :-) – Martijn Pieters Jan 26 '15 at 13:33
  • @Martjin Pieters, well yes, but "this wheel is not supported on this platform?" what? – DedSecz Jan 26 '15 at 13:36
  • @DedSecz: what does `C:\Python34\Scripts\python -c 'import distutils.util; print(distutils.util.get_platform())'` print? – Martijn Pieters Jan 26 '15 at 13:38
  • @Martjin This: https://www.dropbox.com/s/k44omh9wjqy41z4/Screenshot%202015-01-26%2015.40.19.png?dl=0 – DedSecz Jan 26 '15 at 13:41
  • @DedSecz: That's because the command `python` is not found. I gave you a different command however, use `C:\Python34\Scripts\python`. – Martijn Pieters Jan 26 '15 at 13:43
  • @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. – Martijn Pieters Jan 26 '15 at 13:45
  • 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: https://www.dropbox.com/s/0l26qomqk5nmyne/Screenshot%202015-01-26%2015.47.03.png?dl=0 – DedSecz Jan 26 '15 at 13:47
  • @DedSecz: ah, I see I got the path to your Python interpreter wrong. Does `python.exe` work? – Martijn Pieters Jan 26 '15 at 13:56
  • @DedSecz: next attempt: `C:\Python3.4\python -c 'import distutils.util; print(distutils.util.get_platform())'` – Martijn Pieters Jan 26 '15 at 13:57
  • 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" – DedSecz Jan 26 '15 at 13:58
  • @DedSecz: then you have a Python *32-bits installation*, not a 64-bit. You'll need to pick the correct wheel accordingly. – Martijn Pieters Jan 26 '15 at 14:02
  • 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 Jan 26 '15 at 14:05
  • It worked like a charm! Package successfully installed! Thanks a lot Martijn! – DedSecz Jan 26 '15 at 14:10
  • There might be a bug in pip (or somewhere else) as similar things are happening to others: http://stackoverflow.com/questions/28107123/cannot-install-numpy-from-wheel-format/28111899#28111899 (64-bits not being detected) – Simeon Visser Jan 26 '15 at 14:17
  • @SimeonVisser: this isn't a 64-bit Python install. – Martijn Pieters Jan 26 '15 at 14:23
  • @SimeonVisser: remember that you can install a 32-bit Python executable on a 64-bit Windows machine. – Martijn Pieters Jan 26 '15 at 14:24
  • @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. – Simeon Visser Jan 26 '15 at 16:39
  • @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). – Martijn Pieters Jan 26 '15 at 16:41
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.

TingtingW
  • 21
  • 1
1

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
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70
1

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

smartroad
  • 11
  • 1