I am trying to install boost bindings for python3 on Ubuntu Xenial, but it pulls in whole python2.7 dependency tree. I do not want or need python2.7 on my system (Docker image). Is there a way to install only python3 bindings?
I am trying to install boost bindings for python3 on Ubuntu Xenial, but it pulls in whole python2.7 dependency tree. I do not want or need python2.7 on my system (Docker image). Is there a way to install only python3 bindings?
I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:
You have three options:
1. Build Boost.Python yourself
This is the option I recommend: it's clean, there's no risk to mess up your system and you have full control on what you get. Moreover1
so you can just build that. Download the archive and follow the instruction on the Getting Started guide. (This is what OP did.)
2. Use
dpkg
to avoid installing unwanted dependeciesIf you don't want to build Boost.Python yourself, you can bypass
apt
(and its dependencies cheking) withdpkg
.Let's say you want to install a package named
foo
which depends onbar
andbaz
, but you don't actually needbaz
.Notice that
apt
will still complain about unresolved dependencies (but hey, that's its job), so the problem is not entirely solved: you just swept it under the carpet.This option is quicker than the previous one, but I wouldn't recommend it.
3. Use
equivs
to foolapt
This is new to me. Apparently, you can create dummy packages to fulfill the dependencies. In this way, you don't have to install unwanted/unnecessary packages and
apt
will not complain about it.As I said, I've never used
equivs
before, but you can find out more about it here.due to my research, it's not possible
libboost-python-dev
package haslibboost-python1.67-dev
dependency.https://packages.debian.org/sid/libboost-python-dev
and
libboost-python1.67-dev
haspython-dev
dependency which uses python 2https://packages.debian.org/sid/libboost-python1.67-dev
so you cannot do this I think you cannot do this in Debian.
I recommend checking
arch base
andrpm base
distros.I can offer two solutions, one is to build a Python:3.6 image from scratch. Here python3.x becomes the de-facto choice.
Also, another option which worked for me (in Mac OSX) was:
brew install boost-python --with-python3 --without-python