在Program Files中安装keras包时出现权限错误

时间:2017-12-07 21:16:39

标签: python package keras

我需要安装keras包我有anaconda3和python 2.7.13和Windows 10操作系统 在哪里我执行这一行

 pip install keras 

给我这个错误:

 (C:\Program Files\Anaconda) C:\Users\User-47>pip install keras
    Collecting keras
    Using cached Keras-2.1.2-py2.py3-none-any.whl
    Requirement already satisfied: scipy>=0.14 in c:\program 
    files\anaconda\lib\site-packages (from keras)
Requirement already satisfied: numpy>=1.9.1 in c:\program files\anaconda\lib\site-packages (from keras)
Requirement already satisfied: pyyaml in c:\program files\anaconda\lib\site-packages (from keras)
Requirement already satisfied: six>=1.9.0 in c:\program files\anaconda\lib\site-packages (from keras)
Installing collected packages: keras
Exception:
Traceback (most recent call last):
  File "C:\Program Files\Anaconda\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Program Files\Anaconda\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Program Files\Anaconda\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Program Files\Anaconda\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\Anaconda\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Program Files\Anaconda\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "C:\Program Files\Anaconda\lib\site-packages\pip\wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "C:\Program Files\Anaconda\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "C:\Program Files\Anaconda\lib\os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [WinError 5] Accès refusé: 'C:\\Program Files\\Anaconda\\Lib\\site-packages\\keras'

1 个答案:

答案 0 :(得分:0)

答案在例外:PermissionError: [WinError 5] Accès refusé: 'C:\\Program Files\\Anaconda\\Lib\\site-packages\\keras'。在C:\Program Files中安装文件需要管理员帐户,而不是用户帐户。无论谁在机器上安装了Anaconda,都可以使用管理员帐户或在UserAccessControl(UAC)框中输入管理员密码。我有点意外,你没有看到这样的盒子,但我想这取决于Windows版本和设置。

仅为用户帐户安装Anaconda的人必须将其放置或放在其他地方。