PyQt5 pip installation error 13. Permission denied

倖福魔咒の 提交于 2021-02-04 17:38:30

问题


I'm trying to install PyQt5 with the command pip install PyQt5

but I get an error instead.

I use Python 3.5, windows 10.

error:

C:\WINDOWS\system32>pip install PyQt5

Collecting PyQt5
  Using cached PyQt5-5.7-cp35-none-win_amd64.whl
Collecting sip (from PyQt5)
  Using cached sip-4.18.1-cp35-none-win_amd64.whl
Installing collected packages: sip, PyQt5
Exception:
Traceback (most recent call last):
  File "c:\anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,
  File "c:\anaconda3\lib\site-packages\pip\req\req_set.py", line 742, in install
    **kwargs
  File "c:\anaconda3\lib\site-packages\pip\req\req_install.py", line 831, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "c:\anaconda3\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
    isolated=self.isolated,
  File "c:\anaconda3\lib\site-packages\pip\wheel.py", line 346, in move_wheel_files
    clobber(source, lib_dir, True)
  File "c:\anaconda3\lib\site-packages\pip\wheel.py", line 324, in clobber
    shutil.copyfile(srcfile, destfile)
  File "c:\anaconda3\lib\shutil.py", line 115, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'c:\\anaconda3\\Lib\\site-packages\\sip.pyd'

回答1:


With different Windows (8.2) and different PyQt (4-4) I had the same problem.

What worked for me was: run task manager and see if there are any Python tasks running. If there are (there were for me) kill them, as they (probably) lock the sip.pyd file. Then run pip install again ("successfully installed" in my case).




回答2:


Python3.6 Win10 x64 with Anaconda. Same problem as @user6904670 said,

kill running python.exe

and Close Anaconda.exe and other related process




回答3:


Run the cmd window as administrator (https://technet.microsoft.com/en-us/library/cc947813(v=ws.10).aspx)




回答4:


pip install PyQt5

Syntax is not right for PyQt5 because PyQt5 is not compatible with pip, So you have to use pip3. use this command

pip3 install PyQt5

Read this article for more information official http://pyqt.sourceforge.net/Docs/PyQt5/installation.html




回答5:


If your Python 3.x was installed to its preferred (default) location C:\ Program Files \Pyton3x and if you are running your code not with elevated privileges in OS (not as administrator), then consider giving all user permissions to Python installation folder.




回答6:


I had the same problem. If you have Anaconda install try conda navigator and pip



来源:https://stackoverflow.com/questions/38621689/pyqt5-pip-installation-error-13-permission-denied

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