24

We are trying to install PIL and getting the error

error: command 'gcc' failed with exit status 1

Many similar questions, including this one (installing Reportlab (error: command 'gcc' failed with exit status 1 )), suggest installing the python-dev package.

Where can this be sourced for Windows 7. pip install python-dev didn't work.

1
  • the answer is right on the PIL website, they have downloads for windows Commented May 8, 2013 at 19:33

3 Answers 3

21

It seems there is no python-dev package for Windows. But the Python installer for Windows will normally install a sub directory include inside the main Python dir.

So with Python in C:\Python you would get:

  • C:\Python
  • C:\Python\DLLs
  • C:\Python\Doc
  • C:\Python\include
  • C:\Python\Lib
  • C:\Python\libs
  • C:\Python\Scripts
  • C:\Python\tcl
  • C:\Python\Tools

Inside this include directory you will find Python.h, which can be included or referenced.

Sign up to request clarification or add additional context in comments.

5 Comments

I am able to include Python.h, but I have no pyconfig.h. So I am getting Python-2.7.13\Include/Python.h:8:22: fatal error: pyconfig.h: No such file or directory
@MeetTaraviya I’m afraid you’ll have to make that a separate question, because I haven’t done much Python development since answering … don’t remember having needed pyconfig.h. Maybe stackoverflow.com/a/28678231/1548776 is a good hint?
@MeetTaraviya Also have a look at svn.python.org/projects/python/trunk/PC/pyconfig.h. github.com/esa/pagmo/wiki/… suggests pyconfig.h is included …
@MeetTaraviya Good to hear you were able to solve it. Would you please explain briefly for the benefit of others with the same problem?
I founnd out python-config on the system, ran python-config --ldflags and added those flags to linking option
3

When I used to develop on Windows, this website with pre-compiled binaries was extremely handy: http://www.lfd.uci.edu/~gohlke/pythonlibs/

You'll find pre-compiled versions of PIL and ReportLab there. Hope that helps you out.

2 Comments

There is no 64-bit version for Python 2.7
@user1328021 Sorry, see the PIL website for the 64-bit version. You didn't mention anything in your question about 64-bit.
3

The easiest way to get a complete working setup on Windows, including ming compiler, is to install a distribution such as pythonxy (my favorite) or EDP.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.