提供了“Installing TensorFlow on macOS”,但在运行以下命令之后:
$ pip install --upgrade virtualenv
我收到以下消息:
Collecting virtualenv
Using cached virtualenv-15.2.0-py2.py3-none-any.whl
Installing collected packages: virtualenv
Found existing installation: virtualenv 15.1.0
Uninstalling virtualenv-15.1.0:
Exception:
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/shutil.py", line 544, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/anaconda3/lib/python3.6/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst' -> '/var/folders/dm/z1ygt5z102xg25tccf47jnw80000gn/T/pip-j5jm_3mq-uninstall/anaconda3/lib/python3.6/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/anaconda3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/anaconda3/lib/python3.6/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/anaconda3/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/anaconda3/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/anaconda3/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/anaconda3/lib/python3.6/shutil.py", line 559, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/anaconda3/lib/python3.6/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'
我已经从anaconda下载了python 3.6。我对终端不太了解或了解路径的任何问题。
提前谢谢!
答案 0 :(得分:0)
您应该在安装命令中添加sudo
前缀。
所以:
sudo pip install --upgrade virtualenv