我需要将win32api用于rpy2。所以我去了http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32并尝试使用pip安装它。但是,我有下面的错误。如何解决此权限被拒绝的问题?

C:\Anaconda\Scripts\pip-script.py run on 07/09/15 16:48:30
Unpacking c:\users\myname\downloads\pywin32-219-cp34-none-win_amd64.whl

Installing collected packages: pywin32

  Found existing installation: pywin32 218.4

    Uninstalling pywin32:

      Removing file or directory c:\anaconda\lib\site-packages\pywin32-218.4-py2.7.egg-info
      Successfully uninstalled pywin32

  Rolling back uninstall of pywin32

  Replacing c:\anaconda\lib\site-packages\pywin32-218.4-py2.7.egg-info
Cleaning up...

Exception:
Traceback (most recent call last):
  File "C:\Anaconda\lib\site-packages\pip\basecommand.py", line 134, in main
status = self.run(options, args)
  File "C:\Anaconda\lib\site-packages\pip\commands\install.py", line 241, in run
requirement_set.install(install_options, global_options, root=options.root_path)
  File "C:\Anaconda\lib\site-packages\pip\req.py", line 1298, in install
requirement.install(install_options, global_options, *args, **kwargs)
  File "C:\Anaconda\lib\site-packages\pip\req.py", line 595, in install
self.move_wheel_files(self.source_dir)
  File "C:\Anaconda\lib\site-packages\pip\req.py", line 815, in move_wheel_files
move_wheel_files(self.name, self.req, wheeldir, user=self.use_user_site, home=self.target_dir)
  File "C:\Anaconda\lib\site-packages\pip\wheel.py", line 172, in move_wheel_files
clobber(source, lib_dir, True)
  File "C:\Anaconda\lib\site-packages\pip\wheel.py", line 166, in clobber
shutil.move(srcfile, destfile)
  File "C:\Anaconda\lib\shutil.py", line 301, in move
copy2(src, real_dst)
  File "C:\Anaconda\lib\shutil.py", line 130, in copy2
copyfile(src, dst)
  File "C:\Anaconda\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'C:\\Anaconda\\Lib\\site-packages\\win32\\win32api.pyd'

最佳答案

如果只是“权限被拒绝”情况,请尝试在sudo之前添加pip(注意:必须为@ owner/administrator级别)

关于python - 安装pywin32-拒绝win32api.pyd权限,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31310251/

10-13 05:23