Reputation: 75
This question has been asked a lot around the Internet but until now I haven't found someone who's getting the same error as I am (maybe I'm not looking hard enough, who knows).
I'm using a Windows 10 64-bit Acer laptop (I don't know any other specs, it isn't mine) and trying to install pygame‑1.9.3‑cp36‑cp36m‑win32.whl (I've been told it's better to get the 32-bit versions of both Python and Pygame). I receive this error when I go into PowerShell:
PS C:\Program Files (x86)\Python36-32\Scripts> pip3 install pygame-1.9.3-cp36-cp36m-win32.whl
Processing c:\program files (x86)\python36-32\scripts\pygame-1.9.3-cp36-cp36m-win32.whl
Installing collected packages: pygame
Exception:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "c:\program files (x86)\python36-32\lib\os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\Lib\\site-packages\\pygame'
Not too sure what's going on. If anyone does, thanks so much in advance.
Upvotes: 0
Views: 1056
Reputation: 1465
In your case it seems like a permission issue so try to run it as admin. In case it doesn't work this is my advise:
I have always had issues installing python libs in windows until I found this repo, it has never let me down. I have installed pygame from here like 20 times and always works. Try it and let me know: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Upvotes: 1