2017-02-16 114 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