⚡ Sangsakala Proxy 🏠 Home
Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
This repository was archived by the owner on Mar 23, 2026. It is now read-only.

Build Fails on MacOS Sierra #260

Closed
Closed

Description

@mwpenna

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'

Activity

  1. whummer commented on Aug 27, 2017

    @whummer
    Member

    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.

  2. mwpenna commented on Aug 28, 2017

    @mwpenna
    Author

    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

  3. whummer commented on Aug 28, 2017

    @whummer
    Member

    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
    
  4. mwpenna commented on Aug 28, 2017

    @mwpenna
    Author

    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'

  5. whummer commented on Aug 28, 2017

    @whummer
    Member

    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.

  6. jasondavis25 commented on Oct 5, 2017

    @jasondavis25

    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

  7. whummer commented on Oct 8, 2017

    @whummer
    Member

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

  8. Pyrolistical commented on Jul 4, 2019

    @Pyrolistical

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions