如何在anaconda导航器中将张量流环境转移到根环境

时间:2018-05-20 22:30:22

标签: python tensorflow anaconda

我使用anaconda终端成功安装了tensorflow。

指南 - https://www.tensorflow.org/install/install_windows

但是本指南创建了一个名为tensorflow的新环境,因此我希望在我的root环境中安装这个tensorflow,因为它有217个打包器,当我在tensorflow环境中运行python程序时,无法导入root环境打包器。因此,我想在根环境中传输或重新安装tensorflow。

Anaconda Navigator

我打开了anaconda终端和activate root。然后我像在张量流环境中那样键入pip install --ignore-installed --upgrade tensorflow-gpu

然后我得到以下错误。

 Exception:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "C:\ProgramData\Anaconda3\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\ProgramData\\Anaconda3\\Lib\\site-packages\\six.py'
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

如何在我的root环境中安装tensorfow,因为我还想使用217个打包器中的一些。

1 个答案:

答案 0 :(得分:0)

似乎此问题与使用' wb'打开目标文件有关。权限。

您可以尝试使用管理员权限运行Anaconda提示符。为此:

  • 右键点击cmd.exe
  • 选择Run As Adminstrator
  • 导航到您希望运行命令的正确目录
  • 运行命令