Shared Object Files not creating - Boost, Python, Ubuntu 18.04

System : Ubuntu 18.04. Python 3.8 is my global install, but I have multiple local installs of various versions of Python from 2.7, 3.4, 3.6, 3.7, 3.8 and 3.9.

I have a project I am using with a boost dependency. When I try to import it it says

ImportError: libboost_python36.so.1.67.0: cannot open shared object file: No such file or directory.

To confirm it doesn't exist I did

locate libboost_python36

and found no results. However, doing

locate libboost_python

did bring up a file called

libboost_python38.so.1.71.0

Presumably because I needed it for a different project on a different python installation.

To perform the boost install I downloaded the correct version from their release ( boost_1_67_0.tar.gz ) and extracted it. I then did the following commands

cd boost_1_67_0
sudo ./bootstrap.sh --with-python=/home/myusername/.local/bin/python3.6m --with-python-version=python3.6
sudo ./b2 install
sudo ./bjam install

However upon completing I get the same error and I still do not find a file called libboost_python36.so.1.67.0 when I run a locate.

What can I be doing wrong that I am not generating such a shared object file?

Thank you


Solution 1:

You are probably inventing wheel.

All the mentioned software is already packaged in Ubuntu repositories. Start with:

sudo apt-add-repository universe
sudo apt-get update

Use commands below to get Python 3.6 binding for

  • Boost 1.62:

    sudo apt-get install libboost-python1.62-dev
    
  • Boost 1.65:

    sudo apt-get install libboost-python1.65-dev
    

Having Python 3.8 may create problems on system level.