安装pywin32 - win32api.pyd权限被拒绝

时间:2015-07-09 06:59:18

标签: python python-2.7 pywin32 rpy2

我需要将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'

1 个答案:

答案 0 :(得分:-3)

如果只有#34;权限被拒绝"情况,请尝试在sudo之前添加pip(注意:必须是@所有者/管理员级别)