Skip to content

Python.h not found when installing on Ubuntu / virtualenv / pypy #160

@steph-ben

Description

@steph-ben

Everything is good with Python 2.7.3.
I'm just trying with pypy, and unfortunately, it doesn't find Python.h
It fails with:

$ pip install Pillow
running build_ext
building '_imaging' extension
cc -fPIC -Wimplicit -DHAVE_LIBZ -IlibImaging -I/usr/local/include -I/usr/include -I/home/ubuntu/Code/mfi/intmanager/integration-manager/branches/SIS_INDO.gitsvn/ve.pypy/include -I/usr/include/i386-linux-gnu -c _imaging.c -o build/temp.linux-i686-2.7/_imaging.o
_imaging.c:75:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'cc' failed with exit status 1

Python.h is there

$ locate Python.h
/usr/include/python2.7/Python.h

And if I add into setup.py (line 94) the hard-coded path, it's working:

         _add_directory(include_dirs, "libImaging")
+        _add_directory(include_dirs, "/usr/include/python2.7")

Versions:

$ pypy
Python 2.7.2 (1.9+dfsg-1, Jun 19 2012, 23:23:45)
[PyPy 1.9.0 with GCC 4.7.0] on linux2
$ cat /etc/issue
Ubuntu 12.10

Hope it helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InstallationUsually a problem with …

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions