Problem with Python.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Python.

Tommaso Pecorella
Hi all,

as usual… don’t touch anything if things are working, right ?
Well, in this case I had to reinstall Linux on my Linux machine, and I used Mint 18.1.
The problem is: it can’t fin Python…. sort of.

First things first: the machine configuration is this:
 ** System info **
Linux Nightwatch 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Linux Mint 18.1 Serena \n \l

 ** Compiler type and version **
gcc (Ubuntu 4.8.5-4ubuntu2) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 ** ns-3 version **
3-dev
changeset: 12580:e92df2fc93e4 tag: tip user: Stefano Avallone <[hidden email]> date: Fri Jan 27 18:02:38 2017 +0100 summary: traffic-control: (fixes #2537) Fix dead assignment on CoDel::DoDequeue


Waf configure acts strangely:
pecos@Nightwatch ~/workspace/ns-3-allinone/ns-3-dev $ ./waf configure
Setting top to                           : /home/pecos/workspace/ns-3-allinone/ns-3-dev
Setting out to                           : /home/pecos/workspace/ns-3-allinone/ns-3-dev/build
Checking for 'gcc' (C compiler)          : /usr/bin/gcc
Checking for cc version                  : 4.8.5
Checking for 'g++' (C++ compiler)        : /usr/bin/g++
Checking for compilation flag -Wl,--soname=foo support : ok
Checking for program 'python'                          : /usr/bin/python
Checking for python version                            : (2, 7, 12, 'final', 0)
python-config                                          : /usr/bin/python-config
Asking python-config for pyembed '--cflags --libs --ldflags' flags : yes
Testing pyembed configuration                                      : Could not build a python embedded interpreter
Testing pyembed configuration                                      : Could not build a python embedded interpreter
Checking boost includes                                            : 1_58
Checking boost libs                                                : lib signals not found in /usr/lib/x86_64-linux-gnu
Checking boost includes                                            : 1_58
Checking boost libs                                                : lib signals not found in /usr/lib/x86_64-linux-gnu


Notice the "Could not build a python embedded interpreter”.

Pybindgen configuration is even more explicit:

pecos@Nightwatch ~/workspace/ns-3-allinone/pybindgen $ ./waf configure
Setting top to                           : /home/pecos/workspace/ns-3-allinone/pybindgen
Setting out to                           : /home/pecos/workspace/ns-3-allinone/pybindgen/build
Checking for program python              : /usr/bin/python
Checking for python version              : (2, 7, 12, 'final', 0)
Checking for 'gcc' (c compiler)          : /usr/bin/gcc
Checking for 'g++' (c++ compiler)        : /usr/bin/g++
Checking for library python2.7 in LIBDIR : not found
Checking for library python2.7 in python_LIBPL : not found
Checking for library python2.7 in $prefix/libs : not found
Checking for library python2.7m in LIBDIR      : not found
Checking for library python2.7m in python_LIBPL : not found
Checking for library python2.7m in $prefix/libs : not found
Checking for library python27 in LIBDIR         : not found
Checking for library python27 in python_LIBPL   : not found
Checking for library python27 in $prefix/libs   : not found
Checking for program /usr/bin/python-config,python2.7-config,python-config-2.7,python2.7m-config : /usr/bin/python-config
Checking for header Python.h                                                                     : :-(
Asking python-config for pyembed --cflags flags                                                  : yes
Asking python-config for pyembed --libs flags                                                    : yes
Asking python-config for pyembed --ldflags flags                                                 : yes
Getting pyembed flags from python-config                                                         : Could not build a python embedded interpreter


BUT….
pecos@Nightwatch ~/workspace/ns-3-allinone/pybindgen $ locate Python.h
/usr/include/python2.7/Python.h

and

pecos@Nightwatch ~/workspace/ns-3-allinone/pybindgen $ dpkg -l | grep python
ii  dh-python                                   2.20151103ubuntu1.1                        all          Debian helper tools for packaging Python libraries and applications
ii  libpeas-1.0-0-python2loader                 1.16.0-1ubuntu2                            amd64        Application plugin library
ii  libpeas-1.0-0-python3loader                 1.16.0-1ubuntu2                            amd64        Application plugin library
ii  libpython-dev:amd64                         2.7.11-1                                   amd64        header files and a static library for Python (default)
ii  libpython-stdlib:amd64                      2.7.11-1                                   amd64        interactive high-level object-oriented language (default python version)
ii  libpython2.7:amd64                          2.7.12-1ubuntu0~16.04.1                    amd64        Shared Python runtime library (version 2.7)
ii  libpython2.7-dev:amd64                      2.7.12-1ubuntu0~16.04.1                    amd64        Header files and a static library for Python (v2.7)
ii  libpython2.7-minimal:amd64                  2.7.12-1ubuntu0~16.04.1                    amd64        Minimal subset of the Python language (version 2.7)
ii  libpython2.7-stdlib:amd64                   2.7.12-1ubuntu0~16.04.1                    amd64        Interactive high-level object-oriented language (standard library, version 2.7)
ii  libpython3-stdlib:amd64                     3.5.1-3                                    amd64        interactive high-level object-oriented language (default python3 version)
ii  libpython3.5:amd64                          3.5.2-2ubuntu0~16.04.1                     amd64        Shared Python runtime library (version 3.5)
ii  libpython3.5-minimal:amd64                  3.5.2-2ubuntu0~16.04.1                     amd64        Minimal subset of the Python language (version 3.5)
ii  libpython3.5-stdlib:amd64                   3.5.2-2ubuntu0~16.04.1                     amd64        Interactive high-level object-oriented language (standard library, version 3.5)
ii  python                                      2.7.11-1                                   amd64        interactive high-level object-oriented language (default version)
ii  python-alabaster                            0.7.7-1                                    all          Configurable sidebar-enabled Sphinx theme (Python 2)
ii  python-apt                                  1.1.0~beta1build1                          amd64        Python interface to libapt-pkg
ii  python-apt-common                           1.1.0~beta1build1                          all          Python interface to libapt-pkg (locales)
ii  python-aptdaemon                            1.1.1+bzr982-0ubuntu14                     all          Python 2 module for the server and client of aptdaemon
ii  python-aptdaemon.gtk3widgets                1.1.1+bzr982-0ubuntu14                     all          Python 2 GTK+ 3 widgets to run an aptdaemon client
ii  python-attr                                 15.2.0-1                                   all          Attributes without boilerplate (Python 2)
ii  python-babel                                1.3+dfsg.1-6                               all          tools for internationalizing Python applications - Python 2.x
ii  python-babel-localedata                     1.3+dfsg.1-6                               all          tools for internationalizing Python applications - locale data files
ii  python-beautifulsoup                        3.2.1-1                                    all          error-tolerant HTML parser for Python
ii  python-blinker                              1.3.dfsg2-1build1                          all          Fast, simple object-to-object and broadcast signaling library
ii  python-cairo                                1.8.8-2                                    amd64        Python bindings for the Cairo vector graphics library
ii  python-cffi-backend                         1.5.2-1ubuntu1                             amd64        Foreign Function Interface for Python calling C code - backend
ii  python-chardet                              2.3.0-2                                    all          universal character encoding detector for Python2
ii  python-configglue                           1.1.2-0ubuntu3                             all          Glues together optparse.OptionParser and ConfigParser.ConfigParser
ii  python-configobj                            5.0.6-2                                    all          simple but powerful config file reader and writer for Python 2
ii  python-crypto                               2.6.1-6build1                              amd64        cryptographic algorithms and protocols for Python
ii  python-cryptography                         1.2.3-1ubuntu0.1                           amd64        Python library exposing cryptographic recipes and primitives (Python 2)
ii  python-cups                                 1.9.73-0ubuntu2                            amd64        Python bindings for CUPS
ii  python-dbus                                 1.2.0-3                                    amd64        simple interprocess messaging system (Python interface)
ii  python-dbus-dev                             1.2.0-3                                    all          main loop integration development files for python-dbus
ii  python-debian                               0.1.27ubuntu2                              all          Python modules to work with Debian-related data formats
ii  python-debtagshw                            2.0.1ubuntu6                               all          Match debtags hardware:: tags against the actual hardware
ii  python-defer                                1.0.6-2build1                              all          Small framework for asynchronous programming (Python 2)
ii  python-dev                                  2.7.11-1                                   amd64        header files and a static library for Python (default)
ii  python-dirspec                              13.10-1ubuntu1                             all          Python User Folders Specification Library
ii  python-docutils                             0.12+dfsg-1                                all          text processing system for reStructuredText (implemented in Python 2)
ii  python-ecdsa                                0.13-2                                     all          ECDSA cryptographic signature library (Python 2)
ii  python-enum34                               1.1.2-1                                    all          backport of Python 3.4's enum package
ii  python-feedparser                           5.1.3-3build1                              all          Universal Feed Parser for Python
ii  python-gconf                                2.28.1+dfsg-1.1                            amd64        Python bindings for the GConf configuration database system
ii  python-gi                                   3.20.0-0ubuntu1                            amd64        Python 2.x bindings for gobject-introspection libraries
ii  python-gi-cairo                             3.20.0-0ubuntu1                            amd64        Python Cairo bindings for the GObject library
ii  python-glade2                               2.24.0-4ubuntu1                            amd64        GTK+ bindings: Glade support
ii  python-gnomekeyring                         2.32.0+dfsg-3                              amd64        Python bindings for the GNOME keyring library
ii  python-gobject                              3.20.0-0ubuntu1                            all          Python 2.x bindings for GObject - transitional package
ii  python-gobject-2                            2.28.6-12ubuntu1                           amd64        deprecated static Python bindings for the GObject library
ii  python-gtk2                                 2.24.0-4ubuntu1                            amd64        Python bindings for the GTK+ widget set
ii  python-gtksourceview2                       2.10.1-2build1                             amd64        Python bindings for the GtkSourceView widget
ii  python-httplib2                             0.9.1+dfsg-1                               all          comprehensive HTTP client library written for Python
ii  python-idna                                 2.0-3                                      all          Python IDNA2008 (RFC 5891) handling (Python 2)
ii  python-imaging                              3.1.2-0ubuntu1                             all          Python Imaging Library compatibility layer
ii  python-ipaddress                            1.0.16-1                                   all          Backport of Python 3 ipaddress module (Python 2)
ii  python-jinja2                               2.8-1                                      all          small but fast and easy to use stand-alone template engine
ii  python-jwt                                  1.3.0-1                                    all          Python implementation of JSON Web Token
ii  python-ldb                                  2:1.1.24-1ubuntu3                          amd64        Python bindings for LDB
ii  python-libxml2                              2.9.3+dfsg1-1ubuntu0.1                     amd64        Python bindings for the GNOME XML library
ii  python-lockfile                             1:0.12.2-1                                 all          file locking library for Python — Python 2 library
ii  python-lxml                                 3.5.0-1build1                              amd64        pythonic binding for the libxml2 and libxslt libraries
ii  python-mako                                 1.0.3+ds1-1ubuntu1                         all          fast and lightweight templating for the Python platform
ii  python-markupsafe                           0.23-2build2                               amd64        HTML/XHTML/XML string library for Python
ii  python-mate-menu                            1.16.0-1+serena                            amd64        implementation of the freedesktop menu specification for MATE (Python bindings)
ii  python-minimal                              2.7.11-1                                   amd64        minimal subset of the Python language (default version)
ii  python-nemo                                 3.2.0+serena                               amd64        Python binding for Nemo components
ii  python-netifaces                            0.10.4-0.1build2                           amd64        portable network interface information - Python 2.x
ii  python-notify                               0.1.1-4                                    amd64        Python bindings for libnotify
ii  python-oauthlib                             1.0.3-1                                    all          generic, spec-compliant implementation of OAuth for Python
ii  python-oneconf                              0.3.9                                      all          synchronize your configuration data over the network (Python 2)
ii  python-openssl                              0.15.1-2build1                             all          Python 2 wrapper around the OpenSSL library
ii  python-pam                                  0.4.2-13.2ubuntu2                          amd64        Python interface to the PAM library
ii  python-paramiko                             1.16.0-1                                   all          Make ssh v2 connections with Python (Python 2)
ii  python-parted                               3.10.7-2build1                             amd64        Python interface for libparted
ii  python-pexpect                              4.0.1-1                                    all          Python module for automating interactive applications
ii  python-pil:amd64                            3.1.2-0ubuntu1                             amd64        Python Imaging Library (Pillow fork)
ii  python-piston-mini-client                   0.7.5-0ubuntu2                             all          library for writing clients for Django's Piston REST APIs
ii  python-pkg-resources                        20.7.0-1                                   all          Package Discovery and Resource Access using pkg_resources
ii  python-protobuf                             2.6.1-1.3                                  amd64        Python bindings for protocol buffers
ii  python-ptyprocess                           0.5-1                                      all          Run a subprocess in a pseudo terminal from Python 2
ii  python-pyasn1                               0.1.9-1                                    all          ASN.1 library for Python (Python 2 module)
ii  python-pyasn1-modules                       0.0.7-0.1                                  all          Collection of protocols modules written in ASN.1 language
ii  python-pyatspi                              2.18.0+dfsg-3                              all          Assistive Technology Service Provider Interface - Python bindings
ii  python-pyatspi2                             2.18.0+dfsg-3                              all          Transitional package for assistive technology Python bindings
ii  python-pycurl                               7.43.0-1ubuntu1                            amd64        Python bindings to libcurl
ii  python-pygccxml                             1.0.0-5                                    all          specialized XML reader reads the output from gccxml
ii  python-pygments                             2.1+dfsg-1                                 all          syntax highlighting package written in Python
ii  python-pyinotify                            0.9.6-0fakesync1                           all          simple Linux inotify Python bindings
ii  python-pyorbit                              2.24.0-7.1                                 amd64        A Python language binding for the ORBit2 CORBA implementation
ii  python-qt4                                  4.11.4+dfsg-1build4                        amd64        Python bindings for Qt4
ii  python-qt4-dbus                             4.11.4+dfsg-1build4                        amd64        D-Bus Support for PyQt4
ii  python-renderpm:amd64                       3.3.0-1                                    amd64        python low level render interface
ii  python-reportlab                            3.3.0-1                                    all          ReportLab library to create PDF documents using Python
ii  python-reportlab-accel:amd64                3.3.0-1                                    amd64        C coded extension accelerator for the ReportLab Toolkit
ii  python-requests                             2.9.1-3                                    all          elegant and simple HTTP library for Python2, built for human beings
ii  python-roman                                2.0.0-2                                    all          module for generating/analyzing Roman numerals for Python 2
ii  python-samba                                2:4.3.11+dfsg-0ubuntu0.16.04.3             amd64        Python bindings for Samba
ii  python-serial                               3.0.1-1                                    all          pyserial - module encapsulating access for the serial port
ii  python-service-identity                     16.0.0-2                                   all          Service identity verification for pyOpenSSL (Python 2 module)
ii  python-setproctitle                         1.1.8-1build2                              amd64        A setproctitle implementation for Python (Python 2)
ii  python-sexy                                 0.1.9-1ubuntu3-1mint3                      amd64        python language bindings for libsexy
ii  python-sip                                  4.17+dfsg-1build1                          amd64        Python/C++ bindings generator runtime library
ii  python-six                                  1.10.0-3                                   all          Python 2 and 3 compatibility library (Python 2 interface)
ii  python-smbc                                 1.0.15.5-1                                 amd64        Python 2 bindings for the Samba client library
ii  python-sphinx                               1.3.6-2ubuntu1                             all          documentation generator for Python projects (implemented in Python 2)
ii  python-sphinx-rtd-theme                     0.1.9-1                                    all          sphinx theme from readthedocs.org (Python 2)
ii  python-talloc                               2.1.5-2                                    amd64        hierarchical pool based memory allocator - Python bindings
ii  python-tdb                                  1.3.8-2                                    amd64        Python bindings for TDB
ii  python-twisted-bin                          16.0.0-1                                   amd64        Event-based framework for internet applications
ii  python-twisted-core                         16.0.0-1                                   all          Event-based framework for internet applications
ii  python-twisted-names                        16.0.0-1                                   all          twisted package for DNS protocol implementation
ii  python-twisted-web                          16.0.0-1                                   all          twisted dummy package for HTTP protocol implementation
ii  python-tz                                   2014.10~dfsg1-0ubuntu2                     all          Python version of the Olson timezone database
ii  python-ubuntu-sso-client                    13.10-0ubuntu11                            all          Ubuntu Single Sign-On client - Python library
ii  python-urllib3                              1.13.1-2ubuntu0.16.04.1                    all          HTTP library with thread-safe connection pooling for Python
ii  python-utidylib                             0.2-9build1                                all          Python wrapper for TidyLib
ii  python-vte                                  1:0.28.2-5ubuntu3                          amd64        Python bindings for the VTE widget set
ii  python-webkit                               1.1.8-3.1                                  amd64        WebKit/Gtk Python bindings
ii  python-xapian                               1.2.22-2build1                             amd64        Xapian search engine interface for Python
ii  python-xdg                                  0.25-4                                     all          Python 2 library to access freedesktop.org standards
ii  python-xlib                                 0.14+20091101-5                            all          interface for Python to the X11 protocol
ii  python-zope.interface                       4.1.3-1build1                              amd64        Interfaces for Python
ii  python2.7                                   2.7.12-1ubuntu0~16.04.1                    amd64        Interactive high-level object-oriented language (version 2.7)
ii  python2.7-dev                               2.7.12-1ubuntu0~16.04.1                    amd64        Header files and a static library for Python (v2.7)
ii  python2.7-minimal                           2.7.12-1ubuntu0~16.04.1                    amd64        Minimal subset of the Python language (version 2.7)
ii  python3                                     3.5.1-3                                    amd64        interactive high-level object-oriented language (default python3 version)
ii  python3-apt                                 1.1.0~beta1build1                          amd64        Python 3 interface to libapt-pkg
… more python 3 stuff. The default Python is 2.7 anyway.

Any clue ?
Some posts point to a problem in waf, but I’m not an expert on this.

Sorry for the long post. Oh, btw… until I fix this I can’t rebuild the python bindings. Sorry.

Cheers,

T.


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Python.

Tommaso Pecorella
Hi all,

a small update.

I tried with bake.
$ hg clone http://code.nsnam.org/bake <http://code.nsnam.org/bake>
$ cd bake
$ export BAKE_HOME=`pwd`/bake
$ export PATH=$PATH:$BAKE_HOME
$ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
$ ./bake.py check
 … some packages installed manually
$ ./bake.py configure -e ns-3-allinone
$ ./bake.py download
$ ./bake.py build
… almost all green. The only stuff complaining it’s click and openflow. Autotools are still missing, but who cares.

Now go in ns-3-dev (btw, why bake is creating a lot of empty directories like “g++” ? Annoying).

pecos@Nightwatch ~/workspace/bake/source/ns-3-dev $ ./waf --apiscan=sixlowpan
Waf: Entering directory `/home/pecos/workspace/bake/source/ns-3-dev/build'
Cannot re-scan python bindings: (py)gccxml not available

WHAT ?
It did build it just a second ago !
… it’s not in the $PATH tho. Add it manually (I’ll find later why the bake/build/bin directory is missing)… no, it doesn’t work.

Now, should I downgrade to an older Linux ?
I know that THE solution is to migrate to castxml, but we’re going to have some issues in supporting the latest Linux distros if we don’t know how to fix it.

Cheers,

T.

PS: bake gave me an error on pybindgen build, I had to comment some stuff in the setup.py, namely when it tries to read the README.rst.



> On 30 Jan 2017, at 00:17, Tommaso Pecorella <[hidden email]> wrote:
>
> Hi all,
>
> as usual… don’t touch anything if things are working, right ?
> Well, in this case I had to reinstall Linux on my Linux machine, and I used Mint 18.1.
> The problem is: it can’t fin Python…. sort of.
>
> … cutting the old part.


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Python.

Tom Henderson-2
On 01/31/2017 04:34 PM, Tommaso Pecorella wrote:

> Hi all,
>
> a small update.
>
> I tried with bake.
> $ hg clone http://code.nsnam.org/bake <http://code.nsnam.org/bake>
> $ cd bake
> $ export BAKE_HOME=`pwd`/bake
> $ export PATH=$PATH:$BAKE_HOME
> $ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
> $ ./bake.py check
>   … some packages installed manually
> $ ./bake.py configure -e ns-3-allinone
> $ ./bake.py download
> $ ./bake.py build
> … almost all green. The only stuff complaining it’s click and openflow. Autotools are still missing, but who cares.
>
> Now go in ns-3-dev (btw, why bake is creating a lot of empty directories like “g++” ? Annoying).
>
> pecos@Nightwatch ~/workspace/bake/source/ns-3-dev $ ./waf --apiscan=sixlowpan
> Waf: Entering directory `/home/pecos/workspace/bake/source/ns-3-dev/build'
> Cannot re-scan python bindings: (py)gccxml not available
>
> WHAT ?
> It did build it just a second ago !
> … it’s not in the $PATH tho. Add it manually (I’ll find later why the bake/build/bin directory is missing)… no, it doesn’t work.
>
> Now, should I downgrade to an older Linux ?
> I know that THE solution is to migrate to castxml, but we’re going to have some issues in supporting the latest Linux distros if we don’t know how to fix it.

Agreed; someone is working on trying to move us to castxml.  For Ubuntu
16.04, you probably need to manually build gccxml as per instructions in
bug 2451, and make sure your PYTHONPATH is also set to pick up
pygccxml's location.

- Tom

Reply | Threaded
Open this post in threaded view
|

Re: Problem with Python.

Tommaso Pecorella
Thanks for the hint Tom,

I’ll downgrade to Mint 17.3 for the moment. It’s easier for me since I’m not the only one working on that computer.
I’d help with castxml but my skills on that part are less than zero.

Cheers,

T.


> On 1 Feb 2017, at 02:09, Tom Henderson <[hidden email]> wrote:
>
> On 01/31/2017 04:34 PM, Tommaso Pecorella wrote:
>> Hi all,
>>
>> a small update.
>>
>> I tried with bake.
>> $ hg clone http://code.nsnam.org/bake <http://code.nsnam.org/bake>
>> $ cd bake
>> $ export BAKE_HOME=`pwd`/bake
>> $ export PATH=$PATH:$BAKE_HOME
>> $ export PYTHONPATH=$PYTHONPATH:$BAKE_HOME
>> $ ./bake.py check
>>  … some packages installed manually
>> $ ./bake.py configure -e ns-3-allinone
>> $ ./bake.py download
>> $ ./bake.py build
>> … almost all green. The only stuff complaining it’s click and openflow. Autotools are still missing, but who cares.
>>
>> Now go in ns-3-dev (btw, why bake is creating a lot of empty directories like “g++” ? Annoying).
>>
>> pecos@Nightwatch ~/workspace/bake/source/ns-3-dev $ ./waf --apiscan=sixlowpan
>> Waf: Entering directory `/home/pecos/workspace/bake/source/ns-3-dev/build'
>> Cannot re-scan python bindings: (py)gccxml not available
>>
>> WHAT ?
>> It did build it just a second ago !
>> … it’s not in the $PATH tho. Add it manually (I’ll find later why the bake/build/bin directory is missing)… no, it doesn’t work.
>>
>> Now, should I downgrade to an older Linux ?
>> I know that THE solution is to migrate to castxml, but we’re going to have some issues in supporting the latest Linux distros if we don’t know how to fix it.
>
> Agreed; someone is working on trying to move us to castxml.  For Ubuntu 16.04, you probably need to manually build gccxml as per instructions in bug 2451, and make sure your PYTHONPATH is also set to pick up pygccxml's location.
>
> - Tom


signature.asc (817 bytes) Download Attachment