Opened 11 years ago

Last modified 5 years ago

#5677 new Patches

Bootstrap fails with python versions 3.1 and up

Reported by: Eric Barr <eric.barr@…> Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost Release Branch Severity: Problem
Keywords: Cc:

Description

Using bootstrap.sh to build boost with python versions 3.1 and up generates output similar to the following and the subsequent build fails for boost.python:

Detecting Python version... 3.2 Detecting Python root... File "<string>", line 1

import sys; print sys.prefix

SyntaxError: invalid syntax

This appears to be caused by the code checking for the python root using a form of the 'print' function that is no longer valid in later versions of python. Attached is a patch that fixes this issue.

Attachments (1)

python_fix.patch (435 bytes ) - added by Eric Barr <eric.barr@…> 11 years ago.

Download all attachments as: .zip

Change History (6)

by Eric Barr <eric.barr@…>, 11 years ago

Attachment: python_fix.patch added

comment:1 by jonatan.magnusson@…, 9 years ago

If I understand correctly this patch has been applied to trunk but not merged to release yet. It still fails in 1.55.0.

comment:2 by anonymous, 9 years ago

Version: Boost 1.46.1Boost Release Branch

comment:3 by anonymous, 8 years ago

Still fails in 1.57.0

comment:4 by John McGehee, 8 years ago

A workaround is to get the Python root yourself with correct Python 3 syntax and tell bootstrap.py explicitly:

python_root=`python -c "import sys; print(sys.prefix)"`
./bootstrap.sh  --with-python-root=$python_root

comment:5 by James E. King, III, 5 years ago

This was resolved in 1.59.0:

https://github.com/boostorg/boost/commit/51e693134f5c354f2694fe89d14421c85bfacf31#diff-3af436e6760a0c5f1e3d16a3384853a8

I cannot set the milestone to 1.59.0 however so I am going to leave it unresolved until someone with access can.

Note: See TracTickets for help on using tickets.