pip 中的权限问题

在cmd中安装TensorFlow时遇到的问题,出现以下错误。

经查看是关于权限的问题,需要以管理员的身份去pip.

如何切换到管理员身份见以下链接。

http://jingyan.baidu.com/article/ceb9fb10b53ab88cac2ba05b.html



切换后然后继续pip,就可以了。


(C:\Program Files\Anaconda3) C:\Users\zhangD>pip install -U tensorflow

Collecting tensorflow
  Using cached tensorflow-1.3.0-cp35-cp35m-win_amd64.whl
Collecting wheel>=0.26 (from tensorflow)
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Collecting six>=1.10.0 (from tensorflow)
  Using cached six-1.11.0-py2.py3-none-any.whl
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
  Using cached tensorflow_tensorboard-0.1.8-py3-none-any.whl
Collecting protobuf>=3.3.0 (from tensorflow)
  Using cached protobuf-3.4.0-py2.py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow)
  Using cached numpy-1.13.3-cp35-none-win_amd64.whl
Collecting html5lib==0.9999999 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting bleach==1.5.0 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
  Using cached bleach-1.5.0-py2.py3-none-any.whl
Collecting werkzeug>=0.11.10 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
  Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: wheel, six, html5lib, bleach, setuptools, protobuf, werkzeug, markdown, numpy, tensorflow-tensorboard, tensorflow
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
Exception:
Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 538, in move
    os.rename(src, real_dst)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\anaconda3\\lib\\site-packages\\wheel' -> 'C:\\Users\\zhangD\\AppData\\Local\\Temp\\pip-8vfv_nnx-uninstall\\program files\\anaconda3\\lib\\site-packages\\wheel'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
    prefix=options.prefix_path,
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_set.py", line 736, in install
    requirement.uninstall(auto_confirm=True)
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_install.py", line 742, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "C:\Program Files\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 267, in renames
    shutil.move(old, new)
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 550, in move
    rmtree(src)
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 488, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 383, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 381, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] 拒绝访问。: 'c:\\program files\\anaconda3\\lib\\site-packages\\wheel\\archive.py'

你可能感兴趣的:(python)