因此,大家可以看到我們在這裏有蟒蛇和蟒蛇Tensorflow將無法正常工作,也不會卸載任何
Python 3.6.1 |Anaconda 4.4.0 (x86_64)| (default, May 11 2017, 13:04:09)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
然後安裝在使用PIP 3和tfBinaryURL最終測試安裝 -
>>> #python
... import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
ModuleNotFoundError: No module named 'tensorflow'
>>>
Tensorflow
所以我試圖用tensorflow PIP卸載tensorflow但卸載Y/N提示(鍵入 「Y」)
Installing collected packages: tensorflow
Found existing installation: tensorflow 1.3.0
Uninstalling tensorflow-1.3.0:
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/shutil.py", line 544, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/external/__pycache__/__init__.cpython-36.pyc' -> '/var/folders/61/1b15w21n0jbc2sndhd3j7xfr0000gn/T/pip-oepk4q_b-uninstall/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/external/__pycache__/__init__.cpython-36.pyc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/shutil.py", line 559, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/external/__pycache__/__init__.cpython-36.pyc'
後再次
發生這種情況。
如果它是預先安裝的,理想情況下程序#1應該可以工作 - 但事實並非如此。
所以試圖通過蟒蛇做安裝這個時候以防萬一的問題是由於不同版本的Python -
XXXs-MacBook-Pro:~ abi$ virtualenv --system-site-packages -p python3 ~/tensorflow
Running virtualenv with interpreter /Users/abi/anaconda/bin/python3
Using base prefix '/Users/abi/anaconda'
New python executable in /Users/abi/tensorflow/bin/python3
Also creating executable in /Users/abi/tensorflow/bin/python
dyld: Library not loaded: @rpath/libpython3.6m.dylib
Referenced from: /Users/abi/tensorflow/bin/python3
Reason: image not found
ERROR: The executable /Users/abi/tensorflow/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/Users/abi' (should be '/Users/abi/tensorflow')
ERROR: virtualenv is not compatible with this system or executable
你能幫忙嗎?
我猜這是有你的機器上的Python的多個版本中的問題,並與PIP3安裝可能無法安裝到你希望的Python的。雖然我不完全確定。 –
你試過sudo了嗎? –