Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-4627

How to configure ROOT to use python 3 on Ubuntu?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 5.34/00
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None
    • Environment:

      All

      Description

      I would like to use PyROOT with python 3.2, but I can't figure out how to configure the ROOT build for python 3.

      travis@ubuntu:~/build/v5-34-03$ ./configure --with-python-incdir=/usr/include/python3.2mu --with-python-libdir=/usr/lib/python3.2/config-3.2mu | grep python
      Checking for Python.h ... /usr/include/python3.2mu
      Checking for python2.7, libpython2.7, libpython, python, or Python ... no

      travis@ubuntu:~/build/v5-34-03$ which python
      /usr/bin/python

      travis@ubuntu:~/build/v5-34-03$ ls -lh /usr/bin/python*
      lrwxrwxrwx 1 root root 18 Oct 26 03:29 /usr/bin/python -> /usr/bin/python2.7
      lrwxrwxrwx 1 root root 9 Oct 25 11:23 /usr/bin/python2 -> python2.7
      -rwxr-xr-x 1 root root 2.7M Jul 31 22:46 /usr/bin/python2.7
      -rwxr-xr-x 1 root root 1.7K Jul 31 22:45 /usr/bin/python2.7-config
      lrwxrwxrwx 1 root root 16 Apr 17 2012 /usr/bin/python2-config -> python2.7-config
      lrwxrwxrwx 1 root root 9 Apr 14 2012 /usr/bin/python3 -> python3.2
      lrwxrwxrwx 1 root root 11 Oct 19 13:15 /usr/bin/python3.2 -> python3.2mu
      lrwxrwxrwx 1 root root 18 Oct 19 13:15 /usr/bin/python3.2-config -> python3.2mu-config
      -rwxr-xr-x 1 root root 2.7M Oct 19 13:15 /usr/bin/python3.2mu
      -rwxr-xr-x 1 root root 1.8K Oct 19 13:13 /usr/bin/python3.2mu-config
      lrwxrwxrwx 1 root root 16 Apr 14 2012 /usr/bin/python3-config -> python3.2-config
      lrwxrwxrwx 1 root root 11 Apr 14 2012 /usr/bin/python3mu -> python3.2mu
      lrwxrwxrwx 1 root root 18 Apr 14 2012 /usr/bin/python3mu-config -> python3.2mu-config
      lrwxrwxrwx 1 root root 16 Apr 17 2012 /usr/bin/python-config -> python2.7-config

      I think the problem is that the first python on the PATH is used by configure (2.7 in my case) and I have no way to tell it to use another python?

      Symlinking /usr/bin/python to /usr/bin/python3.2 doesn't work, it gives this error:

      travis@ubuntu:~/build/v5-34-03$ sudo ln -sf /usr/bin/python3.2 /usr/bin/python

      travis@ubuntu:~/build/v5-34-03$ ./configure
      Checking for source directory ... /home/travis/build/v5-34-03
      Configuring for linux
      File "/usr/bin/lsb_release", line 67
      print ':'.join(verinfo)
      ^
      SyntaxError: invalid syntax
      File "/usr/bin/lsb_release", line 67
      print ':'.join(verinfo)
      ^
      SyntaxError: invalid syntax
      File "/usr/bin/lsb_release", line 67
      print ':'.join(verinfo)
      ^
      SyntaxError: invalid syntax
      Checking for GNU Make version >= 3.80 ... ok
      Checking for C compiler ... gcc
      Checking for C++ compiler ... g++
      Checking for linker (LD) ... g++
      Checking for F77 compiler ... no F77 compiler gfortran found
      Checking for libX11 ... no
      configure: libX11 MUST be installed
      See http://root.cern.ch/drupal/content/build-prerequisites

        Attachments

          Activity

            People

            Assignee:
            wlav Wim Lavrijsen
            Reporter:
            898a54809b35f7b68226 Christoph Deil
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Actual End: