0

Having issues installing some python modules (for example pandas) and also had some issues installing ipython notebook.

This error seems to have come up before for other folks (Python pip install fails: invalid command egg_info), but they were using Python 2.7, whereas I'm using 2.6 (default with my Mac OS 10.6). Also I tried easy_install -U setuptools and pip install --upgrade setuptools but neither worked.

This is the error I get for installing pandas:

Command python setup.py egg_info failed with error code 1 in /private/var/folders/Wm/WmmbYincEnuCrAMtGBudAk+++TM/-Tmp-/pip_build_AWal/pandas
Storing debug log for failure in /Users/AWal/Library/Logs/pip.log

For installing iPython, this is the error that I get:

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 671, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/req.py", line 901, in move_wheel_files
    pycompile=self.pycompile,
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/wheel.py", line 341, in move_wheel_files
    generated.extend(maker.make_multiple(['%s = %s' % kv for kv in console.items()]))
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 316, in make_multiple
    filenames.extend(self.make(specification, options))
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 305, in make
    self._make_script(entry, filenames, options=options)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 209, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/scripts.py", line 189, in _write_script
    self._fileop.write_binary_file(outname, script_bytes)
  File "/Library/Python/2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_vendor/distlib/util.py", line 384, in write_binary_file
    with open(path, 'wb') as f:
IOError: [Errno 13] Permission denied: '/usr/local/bin/sphinx-apidoc'

Storing debug log for failure in /Users/AWal/Library/Logs/pip.log

Any thoughts on what to do?

UPDATE:

When I do sudo pip install pandas (another module that I can't install), I get a long long traceback with the end error message:

RuntimeError: Broken toolchain: cannot link a simple C program

And traceback (a sample of it of the 100 or so lines) looks like this:

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/private/tmp/pip_build_root/pandas/setup.py", line 619, in <module>

    **setuptools_kwargs)

  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup

  File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 266, in __init__

  File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 312, in fetch_build_eggs

  File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 753, in resolve

  File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1005, in best_match

  File "build/bdist.macosx-10.6-universal/egg/pkg_resources/__init__.py", line 1017, in obtain

  File "build/bdist.macosx-10.6-universal/egg/setuptools/dist.py", line 379, in fetch_build_egg

  File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 619, in easy_install
Community
  • 1
  • 1
user3736169
  • 11
  • 1
  • 1
  • 3
  • try wiht admin right – Hackaholic Jan 01 '15 at 17:59
  • @Hackaholic Tried sudo pip install pandas (another module that is not working), and I got the same error: Command python setup.py egg_info failed with error code 1 in /private/tmp/pip_build_root/pandas Storing debug log for failure in /Users/AWal/Library/Logs/pip.log – user3736169 Jan 01 '15 at 18:03
  • 1
    This might be related http://stackoverflow.com/questions/22388519/problems-with-pip-install-numpy-runtimeerror-broken-toolchain-cannot-link-a – cel Jan 01 '15 at 18:11
  • Do you have XCode (and the tools it brings with itself) installed on your OS X? – sthzg Jan 01 '15 at 18:14
  • @sthzg I don't have xCode that I could find. Is there a way to easily install it? – user3736169 Jan 01 '15 at 18:28
  • 1
    @user3736169 Yes, you can just download it from the Mac App Store. Not 100% sure, but I think installing and opening it brings all the C-based compile tools to life. – sthzg Jan 01 '15 at 18:43

2 Answers2

0

A permission Denied message would suggest you to run your command as root as suggested by Hackaholic. try sudo pip install YOUR_PACKAGE

You might also want to have a look at virtualenv to use a more isolated environment. Under debian based distributions, you might install python-virtualenv package with apt-get install python-virtualenv.

Then create a virtual environment names whatever by typing virtualenv whatever (this will create a folder whatever inside your current folder. Then cd to it and type bin/activate to enter this virtual environment. From there try again your pip install command.

Might help

UPDATE : You might try to use the suggested solutions available here

To sumup, try to add export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future inside ~/.bash_profile

Community
  • 1
  • 1
rebrec
  • 515
  • 4
  • 8
  • 1
    Basically, virtualenv is a good way to go. To install it on a mac (no ``apt-get``), you can follow this [post](http://jamie.curle.io/blog/installing-pip-virtualenv-and-virtualenvwrapper-on-os-x/). However, the update in the OP suggests that there might be an issue with the C compiler, which needs to be solved as well. – sthzg Jan 01 '15 at 18:18
  • @sthzg I think its definitely an issue with the compiler as well. I just tried to command export ARCHFLAGS in the bash_profile as well as with a module (numpy this time, another module that doesn't install for me): sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade numpy. And unfortunately, I got another error: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" etc.... – user3736169 Jan 01 '15 at 18:29
  • @user3736169 in the previous [link i gave you](http://stackoverflow.com/questions/22388519/problems-with-pip-install-numpy-runtimeerror-broken-toolchain-cannot-link-a), some people explain that they had to just open XCode one type and accept the aggreement as this suggested : `I simply had to open XCode and accept the agreement and let it install the tools.` might help you too. – rebrec Jan 01 '15 at 18:52
-1

This question comes first in Google, but the second one actually worked:

pip install -U setuptools

pip install ez_setup
Community
  • 1
  • 1
shellbye
  • 4,620
  • 4
  • 32
  • 44