Python错误13

时间:2017-03-28 20:49:37

标签: python permissions

我们在办公室有一台计算机,当我们从powershell cmd窗口运行“pip install opencv-python”时收到权限错误。

我在一台单独的计算机上对此进行了测试,并且安装顺利。我从域管理员登录尝试在问题机器上执行相同的命令,并获得相同的权限问题。

有任何想法如何解决这个问题?

错误:

PS C:\users> pip install opencv-python
Collecting opencv-python
Using cached opencv_python-3.2.0.6-cp36-cp36m-win32.whl
Collecting numpy>=1.11.3 (from opencv-python)
Using cached numpy-1.12.1-cp36-none-win32.whl
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 324, in run
requirement_set.prepare_files(finder)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "c:\program files (x86)\python36-32\lib\site-packages\pip\download.py", line 663, in unpack_http_url
unpack_file(from_path, location, content_type, link)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 499, in unzip_file
fp = open(fn, 'wb')
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\%username&\\AppData\\Local\\Temp\\pip-build-g1uoy1vs\\numpy\\numpy/distutils/mingw/gfortran_vs2003_hack.c'

1 个答案:

答案 0 :(得分:0)

您必须设置root权限:

sudo pip install opencv-python

现在应该可行