AM_CHECK_PYTHON_HEADERS fails with Python 3
Bug #670100 reported by
Cilyan Olowen
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Poppler Python Bindings |
New
|
Undecided
|
Unassigned |
Bug Description
In Python 3, the print function can no longer be used as a keyword. You need to enclose the parameter in parenthesis like any other function. As such, the following piece of code
import sys; print sys.prefix
is now a syntax error and should be replaced by
import sys; print(sys.prefix)
This error occurs twice in the python.m4 file (or acinclude.m4) and prevents ./configure from working with Python 3.
To post a comment you must log in.
I'm having problems with this.
The error still apeers. I already modificated acinclude.m4 with the parenthesis ad not worked. I get the same error msg.
My ./configure error msg:
checking for python version... 3.2 /lib/python3. 2/site- packages prefix} /lib/python3. 2/site- packages
^
^
checking for python platform... linux2
checking for python script directory... ${prefix}
checking for python extension module directory... ${exec_
checking for headers required to compile python extensions... File "<string>", line 1
import sys; print sys.prefix
SyntaxError: invalid syntax
File "<string>", line 1
import sys; print sys.exec_prefix
SyntaxError: invalid syntax
not found
configure: error: could not find Python headers
My acinclude.m4 file:
AC_MSG_CHECKING(for headers required to compile python extensions) prefix= `$PYTHON -c "import sys; print(sys. exec_prefix) "` INCLUDES= "-I${py_ prefix} /include/ python$ {PYTHON_ VERSION} " INCLUDES= "$PYTHON_ INCLUDES -I${py_ exec_prefix} /include/ python$ {PYTHON_ V$
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"`
py_exec_
PYTHON_
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_
fi
Is this correct?