Ask Your Question
1

./autogen.sh: configure: error: Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS environment variables.

asked 2015-02-15 20:09:57 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

can anyone please help?

checking for python version... 2.7  
checking for python platform... linux2  
checking for python script directory... ${prefix}/lib/python2.7/dist-packages  
checking for python extension module directory... ${exec_prefix}/lib/python2.7/dist-packages  
checking which Python to use for Pyuno... 
checking for a Python interpreter with version >= 3.3... python3  
checking for python3... /usr/bin/python3  
checking for python3 version... 3.4  
checking for python3 platform... linux  
checking for python3 script directory... ${prefix}/lib/python3.4/site-packages  
checking for python3 extension module directory... ${exec_prefix}/lib/python3.4/site-packages
system  
checking Python.h usability... no  
checking Python.h presence... no  
checking for Python.h... no  
configure: error: Python headers not found. You probably want to set both the PYTHON_CFLAGS and PYTHON_LIBS   environment variables.  
Error running configure at ./autogen.sh line 266.  

ThinkPad-T410:~/opensource/office/core$ env | grep python
PYTHON_CLIBS=/usr/include/python3.4/  
PYTHON_LIBS=/usr/include/python3.4  
PYTHON_CFLAGS=/usr/include/python3.4/  

ThinkPad-T410:~/opensource/office/core$ ls /usr/include/python3.4/Python.h   
/usr/include/python3.4/Python.h
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2015-02-15 22:10:49 +0200

LeMoyne gravatar image

first problem looks like: checking Python.h usability... no -- It's a long shot-> maybe check the file permissions in the include dir?

More directly you could try (from $>./autogen.sh --help)

--enable-python= ONE OF: no/auto/system/internal/fully-internal

                      Enables or disables Python support at run-time and
                      build-time. Also specifies what Python to use.
                      'auto' is the default. 'fully-internal' even forces
                      the internal version for uses of Python during the
                      build.

I would try autogen with --enable-python=internal

And if that fails try =fully-internal

As you figure out the flags that you need, add them to <your-path>/core/autogen.input file.

I suggest you ask your future build questions on the dev list -- http://lists.freedesktop.org/mailman/...

All that said, unless you have been setting this option to 'system', the 'auto' default should have fallen back to internal. Poking around in /core, I have seen what appears to be an internal Python 3.3... Looks like you are encountering an issue with the configure script, but I think =internal will help get you further along.

edit flag offensive delete link more
0

answered 2018-11-17 18:33:33 +0200

EasyTrieve gravatar image

I fixed this by installing the libpython3-dev package.

(Note, I already had the libpython-dev installed.)


Before installing this package:

sudo find / -name Python.h
/usr/include/python2.7/Python.h

After installing this package:

sudo find / -name Python.h
/usr/include/python2.7/Python.h
/usr/include/python3.5m/Python.h
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-02-15 20:09:57 +0200

Seen: 1,433 times

Last updated: Nov 17 '18