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
wangbourne opened this Issue Sep 23, 2015 · 38 comments

Comments

Projects
None yet
@wangbourne
Copy link

wangbourne commented Sep 23, 2015

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

This comment has been minimized.

Copy link
Member

kyleknap commented Sep 24, 2015

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.

@thoeni

This comment has been minimized.

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

This comment has been minimized.

Copy link

philcruz commented Oct 3, 2015

Hitting the same error using El Capitan also.

@ericvera

This comment has been minimized.

Copy link

ericvera commented Oct 5, 2015

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

@ibebian

This comment has been minimized.

Copy link

ibebian commented Oct 5, 2015

bump on this, El Capitan not running from virtualenv

@securitybites

This comment has been minimized.

Copy link

securitybites commented Oct 6, 2015

Same issue here on El Capitan.

@securitybites

This comment has been minimized.

Copy link

securitybites commented Oct 6, 2015

Submitted as pip issue: pypa/pip#3165

@JordonPhillips

This comment has been minimized.

Copy link
Member

JordonPhillips commented Oct 6, 2015

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

This comment has been minimized.

Copy link

owendall commented Nov 12, 2015

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

This comment has been minimized.

Copy link

scruffy818 commented Nov 17, 2015

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

@mmtsweng

This comment has been minimized.

Copy link

mmtsweng commented Nov 23, 2015

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

This comment has been minimized.

Copy link

jsgv commented Nov 25, 2015

@mmtsweng that was it. thanks!

@thehesiod

This comment has been minimized.

Copy link

thehesiod commented Nov 25, 2015

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

This comment has been minimized.

Copy link

owntheweb commented Nov 30, 2015

Thanks @mmtsweng

@a-panickar

This comment has been minimized.

Copy link

a-panickar commented Dec 2, 2015

Thanks @mmtsweng, that worked finally!!!!

@aichholzer

This comment has been minimized.

Copy link

aichholzer commented Dec 10, 2015

💯 kudos go to @mmtsweng

@agurha

This comment has been minimized.

Copy link

agurha commented Jan 3, 2016

thanks @mmtsweng

@derrickstaten

This comment has been minimized.

Copy link

derrickstaten commented Jan 5, 2016

Thanks @mmtsweng

@mikeodell77

This comment has been minimized.

Copy link

mikeodell77 commented Jan 7, 2016

Thanks @mmtsweng that did the trick!

@JamesMGreene

This comment has been minimized.

Copy link

JamesMGreene commented Jan 8, 2016

Ditto for me!

@iainwatt

This comment has been minimized.

Copy link

iainwatt commented Jan 11, 2016

@mmtsweng that worked for me thanks!

@kirilgorbachov

This comment has been minimized.

Copy link

kirilgorbachov commented Jan 14, 2016

@mmtsweng Tank you!

@ryanyogan

This comment has been minimized.

Copy link

ryanyogan commented Jan 15, 2016

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

@leecalcote

This comment has been minimized.

Copy link

leecalcote commented Jan 18, 2016

Much appreciated, @mmtsweng!

@yoimbert

This comment has been minimized.

Copy link

yoimbert commented Jan 19, 2016

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

@MattVanZanten

This comment has been minimized.

Copy link

MattVanZanten commented Jan 20, 2016

Thanks for the help @mmtsweng

@PriyaNalang

This comment has been minimized.

Copy link

PriyaNalang commented Jan 21, 2016

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

@adilsoncarvalho

This comment has been minimized.

Copy link

adilsoncarvalho commented Jan 25, 2016

kudos go to @mmtsweng

@dat-vikash

This comment has been minimized.

Copy link

dat-vikash commented Feb 5, 2016

you are a life saver @mmtsweng

@karlhart

This comment has been minimized.

Copy link

karlhart commented Feb 12, 2016

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

@sopepos

This comment has been minimized.

Copy link

sopepos commented Feb 17, 2016

@mmtsweng Thank you!

@awongtv

This comment has been minimized.

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

This comment has been minimized.

Copy link

ghost commented Jun 3, 2018

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

@gemamegantara

This comment has been minimized.

Copy link

gemamegantara commented Jun 28, 2018

@mmtsweng now 2018, still worked 👍

@funnycoding

This comment has been minimized.

Copy link

funnycoding commented Jul 20, 2018

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

@UmaMoiseenko

This comment has been minimized.

Copy link

UmaMoiseenko commented Aug 15, 2018

@mmtsweng right on! Thanks 👍

@ypark9

This comment has been minimized.

Copy link

ypark9 commented Aug 23, 2018

@mmtsweng Mojave public beta working! Thanks!

@manjeesh

This comment has been minimized.

Copy link

manjeesh commented Dec 15, 2018

@mmtsweng Thanks! It worked!

@diehlaws diehlaws added guidance and removed question labels Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment