Failure to install on Mac with macOS Sierra

Issue #52 resolved
Former user created an issue

Installation via 'pip install localstack' fails on MacOS Sierra.

Platform: Mac OS: macOS Sierra Version: 10.12.5 (16F73)

Python: 2.7.10 pip: 9.0.1 (python 2.7.10)

OSError: [Errno 1] Operation not permitted: '/var/folders/r1/5ss_lx313rzb91f7y_4vk0yr0000gn/T/pip-aN9a5h-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

Full error: Installing collected packages: six, cachetools, airspeed, boto, argparse, funcsigs, pbr, mock, amazon-kclpy, docutils, jmespath, botocore, pyYAML, pyasn1, rsa, futures, s3transfer, colorama, awscli, boto3, coverage, docopt, urllib3, elasticsearch, Werkzeug, MarkupSafe, Jinja2, itsdangerous, flask, flask-swagger, ply, decorator, jsonpath-rw, cookies, dicttoxml, xmltodict, pyaml, requests, moto-ext, nose, pep8, psutil, ipaddress, asn1crypto, enum34, idna, pycparser, cffi, cryptography, pyOpenSSL, sh, python-coveralls, requests-aws4auth, subprocess32-ext, localstack 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/r1/5ss_lx313rzb91f7y_4vk0yr0000gn/T/pip-aN9a5h-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

Comments (4)

  1. Waldemar Hummer Account Deactivated

    Thanks for reporting. It seems like there is an issue with file permissions in your local python/pip installation. This sometimes happens if you've installed a package using sudo in the past.

    Are you able to install any other pip packages? For instance, does it also fail if you run pip install six?

    One thing you can do to fix this is make sure that your local user can write to the temporary folders. If you run this command:

    ls -la /var/folders/r1
    

    .. I'd suspect that probably prints something like (note the root user):

    drwxr-xr-x  3 root     wheel       102 Mar 14  2016 .
    drwxr-xr-x  8 root     wheel       272 Apr  4  2016 ..
    drwxr-xr-x  6 root     wheel       204 Jan  5  2017 5ss_lx313rzb91f7y_4vk0yr0000gn
    

    If that is the case, you can run the following command to make your local user the owner of these folders:

    chown -R `whoami` /var/folders/r1/5ss_lx313rzb91f7y_4vk0yr0000gn
    

    Hope that helps.

  2. Alex Terque

    Hi Waldemar,

    Thanks for your reply, however no luck. A lengthy search found this page: How to use pip after the OS X El Capitan upgrade?

    It got me over that first hurdle, so I wanted to share it here, just in case anyone has the same problem, but now I have run into another issue. Here is the output:

    Successfully installed virtualenv-15.1.0
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-build-S31e93/localstack/setup.py", line 102, in <module>
        "Topic :: Software Development :: Testing",
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 575, in run
        self.run_command(cmd_name)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/private/tmp/pip-build-S31e93/localstack/setup.py", line 57, in run
        do_make_install()
      File "/private/tmp/pip-build-S31e93/localstack/setup.py", line 37, in do_make_install
        raise e
    subprocess.CalledProcessError: Command 'make install' returned non-zero exit status 2
    
    ----------------------------------------
    
    Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-S31e93/localstack/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-uZMpuQ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-S31e93/localstack/
    

    I'm not even sure where to start with this issue!

  3. Waldemar Hummer Account Deactivated

    @terque There have been some updates recently, can you please double-check that all requirements are installed (see README), and then give it a try with the latest version. If the problem persists, please raise a ticket in this repository: https://github.com/localstack/localstack (Apologies for moving tickets back and forth.) Thanks!

  4. Log in to comment