Getting the following error when running `pip install -r requirements.txt` #20

Closed
erikvold opened this Issue Jun 29, 2011 · 16 comments

Comments

Projects
None yet
2 participants

error: command 'gcc-4.2' failed with exit status 1


Command /usr/bin/python -c "import setuptools;file='/github/amo-validator/build/coverage/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/1X/1Xsh0G-AHtKgAUtmvTMG7k+++TI/-Tmp-/pip-TSkBxN-record/install-record.txt failed with error code 1
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/pip-1.0-py2.6.egg/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/Library/Python/2.6/site-packages/pip-1.0-py2.6.egg/pip/commands/install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "/Library/Python/2.6/site-packages/pip-1.0-py2.6.egg/pip/req.py", line 1093, in install
requirement.install(install_options, global_options)
File "/Library/Python/2.6/site-packages/pip-1.0-py2.6.egg/pip/req.py", line 566, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Library/Python/2.6/site-packages/pip-1.0-py2.6.egg/pip/init.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command /usr/bin/python -c "import setuptools;file='/github/amo-validator/build/coverage/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/1X/1Xsh0G-AHtKgAUtmvTMG7k+++TI/-Tmp-/pip-TSkBxN-record/install-record.txt failed with error code 1

Owner

mattbasta commented Jun 29, 2011

Looks like coverage is failing to install. A few things:

  • You should probably be running python 2.7. We use that in production and for development. I'll make a note to add that to the README.
  • You should probably use a virtualenv. I doubt that's why this is failing, but it's still a good idea.

Let me know if the first item fixes your problem. If not, I'll need more info on your setup.

Thanks

So I upgraded python from 2.6.x to 2.7.2 on my osx machine, created a virtualenv, activated it and tried pip install -r requirements.txt again but got:

coverage/tracer.c:621: fatal error: error writing to -: Broken pipe

compilation terminated.

lipo: can't open input file: /var/folders/1X/1Xsh0G-AHtKgAUtmvTMG7k+++TI/-Tmp-//ccca71S3.out (No such file or directory)

error: command 'gcc-4.2' failed with exit status 1


Command /Users/erikvold/python-envs/amov/bin/python -c "import setuptools;file='/Users/erikvold/python-envs/amov/build/coverage/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /var/folders/1X/1Xsh0G-AHtKgAUtmvTMG7k+++TI/-Tmp-/pip-olcKmg-record/install-record.txt --install-headers /Users/erikvold/python-envs/amov/bin/../include/site/python2.6 failed with error code 1
Storing complete log in /Users/erikvold/.pip/pip.log

Then I tried in a Ubuntu VM and got:

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c coverage/tracer.c -o build/temp.linux-i686-2.7/coverage/tracer.o

coverage/tracer.c:3:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1


Command /usr/bin/python -c "import setuptools;file='/home/erikvold/github/amo-validator/build/coverage/setup.py';execfile(file)" install --single-version-externally-managed --record /tmp/pip-NtEJ3e-record/install-record.txt failed with error code 1
Storing complete log in /home/erikvold/.pip/pip.log

Let me know what system info you need @mattbasta

Owner

mattbasta commented Jun 29, 2011

Do you have the python-dev package installed?

doesn't look like it

Owner

mattbasta commented Jun 30, 2011

Can you try installing that package and let me know whether it solves the problem? I know that the package is at least available on Ubuntu. If I'm not mistaken, you might be able to get it with easy_install.

erikvold commented Jul 1, 2011

I tried the following on my osx machine and on a ubuntu vm and got the same:

$ easy_install python-dev
Searching for python-dev
Reading http://pypi.python.org/simple/python-dev/
Couldn't find index page for 'python-dev' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for python-dev
error: Could not find suitable distribution for Requirement.parse('python-dev')

Owner

mattbasta commented Jul 2, 2011

So I literally just installed this on a fresh OS X install. Here were my steps:

  • Install homebrew
  • Install XCode
  • Install PIP
  • Install virtualenv
  • Create a virtual environment
  • Clone the validator
  • Run pip install -r requirements.txt

There weren't any errors. Perhaps there's something that you have installed that's conflicting? I unfortunately don't think I can do too much more for you.

erikvold commented Jul 2, 2011

hmm why did u install homebrew? did you install python with it?

erikvold commented Jul 2, 2011

Can you try on a fresh Ubuntu install too btw?

erikvold commented Jul 2, 2011

the python version you were using was 2.6 ?

erikvold commented Jul 2, 2011

what version of xcode did you use too?

erikvold commented Jul 2, 2011

I was using xcode 4

Owner

mattbasta commented Jul 11, 2011

That's probably what the problem is for your mac. I don't know of anyone that's using anything higher than Xcode 3.

As far as Ubuntu goes, I'll have to sit down and try it one day. I've managed to get the validator running fairly easily on Debian, so I'm not entirely sure why it would be failing on Ubuntu.

I used homebrew to help install the Spidermonkey stuff, though that's irrelevant to your issue.

Owner

mattbasta commented Jul 13, 2011

Just heard from another dev that you should try running export ARCHFLAGS="-arch i386" before running the install. It's something of an unofficial bug with coverage on xcode 4.

mattbasta closed this Jul 26, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment