我正在关注AWS的教程,我需要在Mac上安装AWS CLI,结果如下:
sisko$ pip install awscli
Collecting awscli
Using cached awscli-1.10.63-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): docutils>=0.10 in /Library/Python/2.7/site-packages (from awscli)
Requirement already satisfied (use --upgrade to upgrade): rsa<=3.5.0,>=3.1.2 in /Library/Python/2.7/site-packages (from awscli)
Collecting s3transfer<0.2.0,>=0.1.0 (from awscli)
Using cached s3transfer-0.1.3-py2.py3-none-any.whl
Collecting botocore==1.4.53 (from awscli)
Using cached botocore-1.4.53-py2.py3-none-any.whl
Collecting colorama<=0.3.7,>=0.2.5 (from awscli)
Using cached colorama-0.3.7-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pyasn1>=0.1.3 in /Library/Python/2.7/site-packages (from rsa<=3.5.0,>=3.1.2->awscli)
Requirement already satisfied (use --upgrade to upgrade): futures<4.0.0,>=2.2.0; python_version == "2.6" or python_version == "2.7" in /Library/Python/2.7/site-packages (from s3transfer<0.2.0,>=0.1.0->awscli)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.4.53->awscli)
Using cached python_dateutil-2.5.3-py2.py3-none-any.whl
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.4.53->awscli)
Using cached jmespath-0.9.0-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.4.53->awscli)
Using cached six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, jmespath, botocore, s3transfer, colorama, awscli
Found existing installation: six 1.4.1
DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
copy2(src, real_dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
copystat(src, dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/s4/snsk01z551qdj37bpj3dtzpm0000gn/T/pip-38wpB3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
输出的最后一部分抱怨了一个例外情况,我对如何解决这个问题一无所知。
我下载并安装了Python-3.5.2但是当我执行python --version
时,我的命令行报告 Python 2.7.10
答案 0 :(得分:3)
我刚刚意识到有条款可以通过以下方式来抑制该异常:
$ sudo pip install awscli --ignore-installed six
问题已解决。希望这有助于其他人