Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python headers are required to build Mercurial

Tags:

django

I have been following step by step the screencast of kennethlove titled "Getting Started with django". I am stuck in "Episode 6: Generic Views Are Cheaper Than Namebrand". I am trying to install "django-annoying" which requires "Mercurial".

Im using OSX 10.8.2 and when I run on the terminal: pip install mercurial I get the message below.

  Downloading/unpacking mercurial
  Downloading mercurial-2.3.2.tar.gz (3.6MB): 3.6MB downloaded
  Running setup.py egg_info for package mercurial

    Python headers are required to build Mercurial
    Complete output from command python setup.py egg_info:
    running egg_info

creating pip-egg-info/mercurial.egg-info

writing pip-egg-info/mercurial.egg-info/PKG-INFO

writing top-level names to pip-egg-info/mercurial.egg-info/top_level.txt

writing dependency_links to pip-egg-info/mercurial.egg-info/dependency_links.txt

writing manifest file 'pip-egg-info/mercurial.egg-info/SOURCES.txt'

warning: manifest_maker: standard file '-c' not found



Python headers are required to build Mercurial

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /Users/gth158a/Sites/official/poll/build/mercurial
Storing complete log in /Users/gth158a/.pip/pip.log

I have been searching for a solution and the closest I have found is somebody having the same issue in Ubuntu but his proposed solution does not apply in my osx case.

From my research, I learned that the headers referred to are "C headers" to build the app. I have installed the packages I have found in pip that have C headers in its description but no success at all. I would greatly appreciate it if you can point me in the right direction.

like image 727
Jaime Avatar asked Oct 13 '12 05:10

Jaime


3 Answers

I had the same problem on Ubuntu. I installed the "python-dev" package using following command..

sudo apt-get install python-dev

I think installing the same would help for any flavour of Linux.

like image 85
karthi4all Avatar answered Nov 16 '22 05:11

karthi4all


Most probably is just that you don't have the Command Line Tools installed.

The easiest way to install them is to open Xcode go to preferences, Downloads, Components tab --> Command Line Tools (Install)

like image 34
Ixcqc4cGF Avatar answered Nov 16 '22 05:11

Ixcqc4cGF


Pip won't help because it installs python packages. The Python headers are usually installed system-wide. According to this XCode installs the Python headers

like image 1
scytale Avatar answered Nov 16 '22 03:11

scytale