Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

upgrade wstool will return error (looks like due to SIP in El Capitan) #81

Closed
wuhy08 opened this issue Oct 23, 2015 · 18 comments
Closed

Comments

@wuhy08
Copy link

wuhy08 commented Oct 23, 2015

When upgrading wstool in OS X el capitan, it give the following error:

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-cXwzbm/wstool/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-J_oWgn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-cXwzbm/wstool
@tkruse
Copy link
Contributor

tkruse commented Oct 23, 2015

If you can, please paste more context information (like the command you used), and if you used pip (like it seems), try also using a --verbose option.

@jayyoung
Copy link

Also getting a similar error myself on El Capitan when trying to install wstool via pip so I thought I'd pile on:

sudo pip install -U wstool

Gives the following output

Displacer:~ jxy$ sudo pip install -U wstool
Downloading/unpacking wstool
  Running setup.py egg_info for package wstool

Downloading/unpacking vcstools>=0.1.38 (from wstool)
  Running setup.py egg_info for package vcstools

Downloading/unpacking pyyaml (from wstool)
  Running setup.py egg_info for package pyyaml

Downloading/unpacking python-dateutil from https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.2.tar.gz#md5=4ef68e1c485b09e9f034e10473e5add2 (from vcstools>=0.1.38->wstool)
  Running setup.py egg_info for package python-dateutil

Downloading/unpacking six>=1.5 (from python-dateutil->vcstools>=0.1.38->wstool)
  Running setup.py egg_info for package six

    no previously-included directories found matching 'documentation/_build'
Installing collected packages: wstool, vcstools, pyyaml, python-dateutil, six
  Running setup.py install for wstool
    error: [Errno 1] Operation not permitted: '/usr/share/zsh/site-functions/_wstool'
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/wstool/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0wQJiJ-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

running build_scripts

running install_lib

running install_data

copying completion/_wstool -> /usr/share/zsh/site-functions

error: [Errno 1] Operation not permitted: '/usr/share/zsh/site-functions/_wstool'

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/wstool/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0wQJiJ-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/wstool
Storing complete log in /Users/jxy/Library/Logs/pip.log

@tkruse
Copy link
Contributor

tkruse commented Oct 23, 2015

This seems to be related to installation of zsh completion. it seems strange that there should be a permission problem when sudo is being used, but maybe it's a missing directory or something. @jayyoung, do you have a /usr/share/zsh/site-functions/ directory on your system?

@jayyoung
Copy link

Yes I do, this directory is blank however. I have a Linux (Ubuntu 14.04) system here which has ROS Indigo installed all fine, and it also has that directory, but it contains two files named _wstool and wstool-completion.bash

@tkruse
Copy link
Contributor

tkruse commented Oct 23, 2015

Then I have no clue. Does pip install -v ... provide more info about that operation?

@jayyoung
Copy link

Yes that does reveal some more information, specifically a python Exception trace.

Downloading/unpacking wstool
  Running setup.py egg_info for package wstool
    running egg_info
    writing requirements to pip-egg-info/wstool.egg-info/requires.txt
    writing pip-egg-info/wstool.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/wstool.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/wstool.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/wstool.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'pip-egg-info/wstool.egg-info/SOURCES.txt'
Downloading/unpacking vcstools>=0.1.38 (from wstool)
  Running setup.py egg_info for package vcstools
    running egg_info
    writing requirements to pip-egg-info/vcstools.egg-info/requires.txt
    writing pip-egg-info/vcstools.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/vcstools.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/vcstools.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/vcstools.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/vcstools.egg-info/SOURCES.txt'
Downloading/unpacking pyyaml (from wstool)
  Running setup.py egg_info for package pyyaml
    running egg_info
    writing pip-egg-info/PyYAML.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/PyYAML.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/PyYAML.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/PyYAML.egg-info/SOURCES.txt'
    writing manifest file 'pip-egg-info/PyYAML.egg-info/SOURCES.txt'
Using version 2.4.2 (newest of versions: 2.4.2, 2.4.1.post1, 2.4.1.post1, 2.4.1, 2.4.0, 2.3, 2.2, 2.1, 2.0, 1.5, 1.5, 1.5, 1.4.1, 1.4.1, 1.4, 1.4, 1.3, 1.2, 1.1, 1.0)
Downloading/unpacking python-dateutil from https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.4.2.tar.gz#md5=4ef68e1c485b09e9f034e10473e5add2 (from vcstools>=0.1.38->wstool)
  Running setup.py egg_info for package python-dateutil
    running egg_info
    writing requirements to pip-egg-info/python_dateutil.egg-info/requires.txt
    writing pip-egg-info/python_dateutil.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/python_dateutil.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/python_dateutil.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/python_dateutil.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'pip-egg-info/python_dateutil.egg-info/SOURCES.txt'
Downloading/unpacking six>=1.5 (from python-dateutil->vcstools>=0.1.38->wstool)
  Running setup.py egg_info for package six
    running egg_info
    writing pip-egg-info/six.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/six.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/six.egg-info/dependency_links.txt
    warning: manifest_maker: standard file '-c' not found

    reading manifest file 'pip-egg-info/six.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    no previously-included directories found matching 'documentation/_build'
    writing manifest file 'pip-egg-info/six.egg-info/SOURCES.txt'
Installing collected packages: wstool, vcstools, pyyaml, python-dateutil, six
  Running setup.py install for wstool
    running install
    running build
    running build_py
    running build_scripts
    running install_lib
    running install_data
    copying completion/_wstool -> /usr/share/zsh/site-functions
    error: [Errno 1] Operation not permitted: '/usr/share/zsh/site-functions/_wstool'
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/wstool/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sstNBJ-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

running build_scripts

running install_lib

running install_data

copying completion/_wstool -> /usr/share/zsh/site-functions

error: [Errno 1] Operation not permitted: '/usr/share/zsh/site-functions/_wstool'

----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/wstool/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sstNBJ-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/wstool
Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 261, in run
    requirement_set.install(install_options, global_options)
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 1166, in install
    requirement.install(install_options, global_options)
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 589, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/util.py", line 612, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build/wstool/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-sstNBJ-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/wstool

Storing complete log in /Users/jxy/Library/Logs/pip.log

@tkruse
Copy link
Contributor

tkruse commented Oct 25, 2015

Still not very helpful information, but I found this:
http://stackoverflow.com/questions/31900008/oserror-errno-1-operation-not-permitted-when-installing-scrapy-in-osx-10-11
http://stackoverflow.com/questions/33004708/osx-el-capitan-sudo-pip-install-oserror-errno-1-operation-not-permitted

Does any of that help?

Not sure what should be done on our side to prevent any of this from failing the installation.

@wuhy08
Copy link
Author

wuhy08 commented Oct 25, 2015

I did an uninstallation of ROS and then a clean install and solve the problem. There were a lot of difficulties in the process thoug

@jayyoung
Copy link

@tkruse this is definitely the culprit, after disabling the System Integrity Protection as described here wstool installed just fine.

Seems there is little to be done on your end, but maybe a note in any installation instructions regarding this would avoid future questions, as the OS offers no info regarding why it happens. Thanks!

@wjwwood
Copy link
Contributor

wjwwood commented Oct 26, 2015

@wkentaro can you check to see if installing the completion scripts into /usr/local/share/zsh/... works? If so we should change it to install there, which would work around this system integrity protection issue.

@wkentaro
Copy link
Contributor

@wjwwood Yes. If you install wstool without sudo, the completion script will be installed as /usr/local/share/zsh/site-functions/_wstool (and /usr/local/etc/share/bash_completion.d/wstool-completion.bash for bash).

wkentaro added a commit to wkentaro/wstool that referenced this issue Oct 26, 2015
@wjwwood
Copy link
Contributor

wjwwood commented Oct 26, 2015

@wkentaro but does that allow zsh completion to work out of the box?

@wkentaro
Copy link
Contributor

@wjwwood What do you mean with "work out of the box"?

@wjwwood
Copy link
Contributor

wjwwood commented Oct 26, 2015

@wkentaro My understanding was that they needed to be installed to /usr so that the completion would be picked up automatically without changing any settings or environment variables.

@wkentaro
Copy link
Contributor

@wjwwood That depends on how zsh is installed. If you are using default zsh, it does not work. (if installed via brew it does work).

@wjwwood
Copy link
Contributor

wjwwood commented Oct 26, 2015

@wkentaro ok, so maybe in addition to the pull request you opened, we need to add a note to the documentation saying that you need to add the directory /usr/local/share/zsh somehow to the system zsh's shell completion in order for it to work? I can try to add that now that I know that it is required.

@garaemon
Copy link

Could you release new version to avoid this issue?
pip install wstool does not work but pip install git+https://github.com/vcstools/wstool works.

@wjwwood
Copy link
Contributor

wjwwood commented Jan 31, 2016

It's on my list. I'll try to do it this week.

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

No branches or pull requests

6 participants