Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build Fails on MacOS Sierra #260

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

Closed
mwpenna opened this issue Aug 24, 2017 · 8 comments
Closed

Build Fails on MacOS Sierra #260

mwpenna opened this issue Aug 24, 2017 · 8 comments

Comments

@mwpenna
Copy link

mwpenna commented Aug 24, 2017

Build is failing when issuing the following command: pip install localstack
Stack trace is:
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-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-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: '/tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

@whummer
Copy link
Member

whummer commented Aug 27, 2017

Thanks for reporting @mwpenna . This appears to be a duplicate of #248 - can we please continue the discussion on the other ticket and close this one. This looks like an issue with file permissions ("Operation not permitted") - sometimes that happens when you've been running pip install using sudo or a different system user in the past.

What is the output of this command:

ls -la /tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info

Looks like this could be related to this one: pypa/pip#3165 . One of the solutions suggested is to re-install using the --ignore-installed flag.

@mwpenna
Copy link
Author

mwpenna commented Aug 28, 2017

I tried using the --ignore-installed flag and still got the same error. The output from above command was: ls: /tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info: Permission denied
When i run it with sudo i get the following:
-rw-r--r-- 1 root wheel 1422 Jul 30 2016 /tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info

@whummer
Copy link
Member

whummer commented Aug 28, 2017

This folder should not be owned by root, or at least it should be modifiable with your local user. Can you try to run this:

sudo chmod -R 777 /tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib

... and then try to re-install:

pip install --no-cache --upgrade localstack

@mwpenna
Copy link
Author

mwpenna commented Aug 28, 2017

Build failed with the following error output:
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-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-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/gc/cq25hthn6sv04yhn8npf8b21xjkw8p/T/pip-kbMo_s-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

@whummer
Copy link
Member

whummer commented Aug 28, 2017

OK, we're getting closer. Looks like setting permissions is not enough, we need to be the owner of the temporary directory. Can you please try:

sudo chown -R `whoami` /tmp/pip-1FIMZk-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib
sudo chown -R `whoami` /var/folders/gc/cq25hthn6sv04yhn8npf8b21xjkw8p/T/pip-kbMo_s-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib
pip install --no-cache --upgrade localstack

Edit: actually, this might be related to a broken default version of Python, see https://stackoverflow.com/questions/31900008/oserror-errno-1-operation-not-permitted-when-installing-scrapy-in-osx-10-11 . The way it was solved there is to run: brew install python. Might be worth a try as well.

@jasondavis25
Copy link

I was able to get this installed on MacOS Sierra with the following:

Uninstall old version of pip (if necessary)
sudo pip uninstall pip

Install python from brew
brew install python

Make sure pip is working after brew install
which pip

If not, run this
brew unlink python && brew link python

To resolve permission errors, I ran install with the --user flag
pip install --user localstack

@whummer
Copy link
Member

whummer commented Oct 8, 2017

Closing this issue as resolved, with the solution from @p1ng . Please re-open if the problem persists. Thanks

@Pyrolistical
Copy link

Pyrolistical commented Jul 4, 2019

@jasondavis25 2 years later, now brew install python installs python 3, which means pip3.
Command that work today are:

brew install python
pip3 install --user localstack

// starting sqs only for example
SERVICES=sqs /Users/YOU/Library/Python/3.7/bin/localstack start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants