Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to install aws-cli via sudo pip install awscli #1522

Closed
skywalkerlw opened this issue Sep 23, 2015 · 40 comments
Closed

Fail to install aws-cli via sudo pip install awscli #1522

skywalkerlw opened this issue Sep 23, 2015 · 40 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.

Comments

@skywalkerlw
Copy link

I'm on El Capitan OSX. Got following error:

Installing collected packages: six, python-dateutil, docutils, botocore, pyasn1, rsa, 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/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/init.py", line 315, 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: '/tmp/pip-ion1Bt-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
Bournes-MacBook-Pro:~ BourneWang$

@kyleknap
Copy link
Member

This looks like something with how pip handles uninstalling libraries that it did not install in the first place, in this case looks like libraries installed with disutils. It might be worth looking around the pypa github org to see if there is any workarounds they suggest.

One question that I have is are running this from a virtual environment created from virtualenv? It might be worth looking into that so you can avoid uninstalling dependencies that are installed system wide, and it will isolate all dependencies to that environment so you should be able to avoid such errors. Let me know if that helps.

@kyleknap kyleknap added question closing-soon This issue will automatically close in 4 days unless further comments are made. labels Sep 24, 2015
@thoeni
Copy link

thoeni commented Oct 2, 2015

Same issue with me, El Captain as well... I'll check on pip repository if there's any solution...

@philcruz
Copy link

philcruz commented Oct 3, 2015

Hitting the same error using El Capitan also.

@ericvera
Copy link

ericvera commented Oct 5, 2015

Same issue here on El Capitan. To @kyleknap question I am not on a virtual machine.

@ibebian
Copy link

ibebian commented Oct 5, 2015

bump on this, El Capitan not running from virtualenv

@securitybites
Copy link

Same issue here on El Capitan.

@securitybites
Copy link

Submitted as pip issue: pypa/pip#3165

@JordonPhillips
Copy link
Member

This looks like an issue with pip / El Capitan. Since @jtkinser opened an issue with pip, I'm gonna close out the issue here.

@owendall
Copy link

I am having the same issue:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 211, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 311, in run
root=options.root_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 640, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 125, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/init.py", line 315, 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/c3/xn7lnb2x6bb3413qvq135tt40000gn/T/pip-NsJxa7-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

@scruffy818
Copy link

I'm having the exact same issue. Has anybody found a fix or workaround for this yet?

@mmtsweng
Copy link

After many many attempts, the following finally got awscli installed on El Capitan (bare metal, not virtual):

sudo -H pip install awscli --upgrade --ignore-installed six

@jsgv
Copy link

jsgv commented Nov 25, 2015

@mmtsweng that was it. thanks!

@thehesiod
Copy link

I'm almost positive this is due to the new System Integrity Protection. I suggest not trying to update/use the system version of python...try a brewed version.

@owntheweb-archive
Copy link

Thanks @mmtsweng

@a-panickar
Copy link

Thanks @mmtsweng, that worked finally!!!!

@aichholzer
Copy link

💯 kudos go to @mmtsweng

@agurha
Copy link

agurha commented Jan 3, 2016

thanks @mmtsweng

@derrick-branch
Copy link

Thanks @mmtsweng

@mikeodell77
Copy link

Thanks @mmtsweng that did the trick!

@JamesMGreene
Copy link

Ditto for me!

@iainwatt
Copy link

@mmtsweng that worked for me thanks!

@kirilgorbachov
Copy link

@mmtsweng Tank you!

@ryanyogan
Copy link

Thanks @mmtsweng! Saved my morning from diving into my python setup

@leecalcote
Copy link

Much appreciated, @mmtsweng!

@yoimbert
Copy link

Thx @mmtsweng !
just perfect 👍
sudo -H pip install awscli --upgrade --ignore-installed six

@mvanzanten
Copy link

Thanks for the help @mmtsweng

@ghost
Copy link

ghost commented Jan 21, 2016

Thanks @mmtsweng.. it worked !!!!!!!!!!!!

@adilsoncarvalho
Copy link

kudos go to @mmtsweng

@dat-vikash
Copy link

you are a life saver @mmtsweng

@karlhart
Copy link

I used pip install --upgrade awscli --user and it worked.

@sopepos
Copy link

sopepos commented Feb 17, 2016

@mmtsweng Thank you!

@awongtv
Copy link

awongtv commented Feb 19, 2016

Worked!! Thanks!

@aws aws locked and limited conversation to collaborators Feb 19, 2016
@aws aws unlocked this conversation Feb 21, 2018
@ghost
Copy link

ghost commented Jun 3, 2018

Spot on thanks!
sudo -H pip install awscli --upgrade --ignore-installed six

@gemamegantara
Copy link

@mmtsweng now 2018, still worked 👍

@funnycoding
Copy link

@mmtsweng
you save me. it's still worked on macOS highsierra 10.13.5

@UmaMoiseenko
Copy link

@mmtsweng right on! Thanks 👍

@ypark9
Copy link

ypark9 commented Aug 23, 2018

@mmtsweng Mojave public beta working! Thanks!

@manjeesh
Copy link

@mmtsweng Thanks! It worked!

@diehlaws diehlaws added guidance Question that needs advice or information. and removed question labels Jan 4, 2019
@arsalanhaqs
Copy link

arsalanhaqs commented Oct 30, 2019

@mmtsweng Its 2019 and it did work for me, Thanks!

@justdvl
Copy link

justdvl commented Jun 20, 2022

Restarting terminal window worked for me, weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests