2017-02-16 95 views
0

我试图在最近发布后升级到TensorFlow v1.0,但是pip无法为我安装。我最初无法升级到WIndows上的tensorflow v1.0

pip install tensorflow-gpu

安装了它,并试图运行

pip install --upgrade tensorflow-gpu

但我得到了以下的输出:

C:\tensorflow_projects\Cinder\blocks\my-tensorflow\example_mnist\python [master ≡ +1 ~1 -0 !]> pip install --upgrade tensorflow-gpu 
Collecting tensorflow-gpu 
    Using cached tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl 
Requirement already up-to-date: wheel>=0.26 in c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages (from tensorflow-gpu) 
Requirement already up-to-date: numpy>=1.11.0 in c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages (from tensorflow-gpu) 
Requirement already up-to-date: six>=1.10.0 in c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages (from tensorflow-gpu) 
Requirement already up-to-date: protobuf>=3.1.0 in c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages (from tensorflow-gpu) 
Collecting setuptools (from protobuf>=3.1.0->tensorflow-gpu) 
    Using cached setuptools-34.2.0-py2.py3-none-any.whl 
Collecting appdirs>=1.4.0 (from setuptools->protobuf>=3.1.0->tensorflow-gpu) 
    Using cached appdirs-1.4.0-py2.py3-none-any.whl 
Collecting packaging>=16.8 (from setuptools->protobuf>=3.1.0->tensorflow-gpu) 
    Using cached packaging-16.8-py2.py3-none-any.whl 
Requirement already up-to-date: pyparsing in c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages (from packaging>=16.8->setuptools->protobuf>=3.1.0- 
>tensorflow-gpu) 
Installing collected packages: tensorflow-gpu, appdirs, packaging, setuptools 
    Found existing installation: tensorflow-gpu 0.12.1 
    Uninstalling tensorflow-gpu-0.12.1: 
Exception: 
Traceback (most recent call last): 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\shutil.py", line 544, in move 
    os.rename(src, real_dst) 
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'c:\\users\\my_user\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\tensorflow 
\\contrib\\tensor_forest\\hybrid\\python\\kernel_tests\\__pycache__\\k_feature_routing_function_op_test.cpython-35.pyc' -> 'C:\\Users\\NATHAN~1\\AppData\\Local\\Temp\\pip-z9anp1kq- 
uninstall\\users\\my_user\\appdata\\local\\programs\\python\\python35\\lib\\site-packages\\tensorflow\\contrib\\tensor_forest\\hybrid\\python\\kernel_tests\\__pycache__\\ 
k_feature_routing_function_op_test.cpython-35.pyc' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\commands\install.py", line 342, in run 
    prefix=options.prefix_path, 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_set.py", line 778, in install 
    requirement.uninstall(auto_confirm=True) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_install.py", line 754, in uninstall 
    paths_to_remove.remove(auto_confirm) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove 
    renames(path, new_path) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\site-packages\pip\utils\__init__.py", line 267, in renames 
    shutil.move(old, new) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\shutil.py", line 558, in move 
    copy_function(src, real_dst) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\shutil.py", line 257, in copy2 
    copyfile(src, dst, follow_symlinks=follow_symlinks) 
    File "c:\users\my_user\appdata\local\programs\python\python35\lib\shutil.py", line 121, in copyfile 
    with open(dst, 'wb') as fdst: 
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\NATHAN~1\\AppData\\Local\\Temp\\pip-z9anp1kq-uninstall\\users\\my_user\\appdata\\local\\programs\\pyth 
on\\python35\\lib\\site-packages\\tensorflow\\contrib\\tensor_forest\\hybrid\\python\\kernel_tests\\__pycache__\\k_feature_routing_function_op_test.cpython-35.pyc' 

我试图手动卸载tensorflow -gpu与点,但我无法卸载它,它看起来像除非我可以卸载它,我不能upg抢到最新版本。

为什么pip无法卸载tensorflow的想法?

回答

1

看起来问题是,Windows路径长度超过260个字符时无法正确解析。

为了解决这个问题,将注册表值HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled设置为1

我发现蟒蛇3.5主页解决方案:

https://docs.python.org/3/using/windows.html