Installing libboost-python-dev for python3 without installing python2.7











up vote
5
down vote

favorite
1












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?










share|improve this question




























    up vote
    5
    down vote

    favorite
    1












    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?










    share|improve this question


























      up vote
      5
      down vote

      favorite
      1









      up vote
      5
      down vote

      favorite
      1






      1





      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?










      share|improve this question















      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?







      16.04 python3 boost






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 at 20:20









      Ketan Patel

      9,97594365




      9,97594365










      asked Aug 8 '17 at 0:10









      Mitar

      79678




      79678






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          2
          down vote



          +400










          I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:



          # We have to compile it ourselves against the custom Python and cannot use Debian package.
          # Includes a symlink workaround for: https://svn.boost.org/trac10/ticket/11120
          RUN cd /usr/src &&
          wget --no-verbose https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz &&
          tar xzf boost_1_65_1.tar.gz &&
          cd boost_1_65_1 &&
          ln -s /usr/local/include/python3.6m /usr/local/include/python3.6 &&
          ./bootstrap.sh --with-python=$(which python3) &&
          ./b2 install &&
          rm /usr/local/include/python3.6 &&
          ldconfig &&
          cd / && rm -rf /usr/src/*





          share|improve this answer




























            up vote
            1
            down vote













            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




            Boost.Python is a separately-compiled (as opposed to header-only) library




            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 dependecies



            If you don't want to build Boost.Python yourself, you can bypass apt (and its dependencies cheking) with dpkg.



            Let's say you want to install a package named foo which depends on bar and baz, but you don't actually need baz.



            apt download foo bar
            sudo dpkg --ignore-depends=baz --install foo.deb bar.deb


            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 fool apt



            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.






            share|improve this answer






























              up vote
              0
              down vote













              due to my research, it's not possible



              libboost-python-dev package has libboost-python1.67-dev dependency.



              https://packages.debian.org/sid/libboost-python-dev



              and libboost-python1.67-dev has python-dev dependency which uses python 2



              https://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 and rpm base distros.






              share|improve this answer




























                up vote
                -2
                down vote













                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






                share|improve this answer

















                • 2




                  Homebrew on Ubuntu??
                  – Leopd
                  Nov 19 at 19:48











                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "89"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                 

                draft saved


                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f944035%2finstalling-libboost-python-dev-for-python3-without-installing-python2-7%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                2
                down vote



                +400










                I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:



                # We have to compile it ourselves against the custom Python and cannot use Debian package.
                # Includes a symlink workaround for: https://svn.boost.org/trac10/ticket/11120
                RUN cd /usr/src &&
                wget --no-verbose https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz &&
                tar xzf boost_1_65_1.tar.gz &&
                cd boost_1_65_1 &&
                ln -s /usr/local/include/python3.6m /usr/local/include/python3.6 &&
                ./bootstrap.sh --with-python=$(which python3) &&
                ./b2 install &&
                rm /usr/local/include/python3.6 &&
                ldconfig &&
                cd / && rm -rf /usr/src/*





                share|improve this answer

























                  up vote
                  2
                  down vote



                  +400










                  I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:



                  # We have to compile it ourselves against the custom Python and cannot use Debian package.
                  # Includes a symlink workaround for: https://svn.boost.org/trac10/ticket/11120
                  RUN cd /usr/src &&
                  wget --no-verbose https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz &&
                  tar xzf boost_1_65_1.tar.gz &&
                  cd boost_1_65_1 &&
                  ln -s /usr/local/include/python3.6m /usr/local/include/python3.6 &&
                  ./bootstrap.sh --with-python=$(which python3) &&
                  ./b2 install &&
                  rm /usr/local/include/python3.6 &&
                  ldconfig &&
                  cd / && rm -rf /usr/src/*





                  share|improve this answer























                    up vote
                    2
                    down vote



                    +400







                    up vote
                    2
                    down vote



                    +400




                    +400




                    I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:



                    # We have to compile it ourselves against the custom Python and cannot use Debian package.
                    # Includes a symlink workaround for: https://svn.boost.org/trac10/ticket/11120
                    RUN cd /usr/src &&
                    wget --no-verbose https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz &&
                    tar xzf boost_1_65_1.tar.gz &&
                    cd boost_1_65_1 &&
                    ln -s /usr/local/include/python3.6m /usr/local/include/python3.6 &&
                    ./bootstrap.sh --with-python=$(which python3) &&
                    ./b2 install &&
                    rm /usr/local/include/python3.6 &&
                    ldconfig &&
                    cd / && rm -rf /usr/src/*





                    share|improve this answer












                    I have resolved to compiling and installing boost myself (I also installed/compiled Python 3.6 myself.). I have in my Dockerfile now:



                    # We have to compile it ourselves against the custom Python and cannot use Debian package.
                    # Includes a symlink workaround for: https://svn.boost.org/trac10/ticket/11120
                    RUN cd /usr/src &&
                    wget --no-verbose https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz &&
                    tar xzf boost_1_65_1.tar.gz &&
                    cd boost_1_65_1 &&
                    ln -s /usr/local/include/python3.6m /usr/local/include/python3.6 &&
                    ./bootstrap.sh --with-python=$(which python3) &&
                    ./b2 install &&
                    rm /usr/local/include/python3.6 &&
                    ldconfig &&
                    cd / && rm -rf /usr/src/*






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 21 at 2:08









                    Mitar

                    79678




                    79678
























                        up vote
                        1
                        down vote













                        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




                        Boost.Python is a separately-compiled (as opposed to header-only) library




                        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 dependecies



                        If you don't want to build Boost.Python yourself, you can bypass apt (and its dependencies cheking) with dpkg.



                        Let's say you want to install a package named foo which depends on bar and baz, but you don't actually need baz.



                        apt download foo bar
                        sudo dpkg --ignore-depends=baz --install foo.deb bar.deb


                        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 fool apt



                        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.






                        share|improve this answer



























                          up vote
                          1
                          down vote













                          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




                          Boost.Python is a separately-compiled (as opposed to header-only) library




                          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 dependecies



                          If you don't want to build Boost.Python yourself, you can bypass apt (and its dependencies cheking) with dpkg.



                          Let's say you want to install a package named foo which depends on bar and baz, but you don't actually need baz.



                          apt download foo bar
                          sudo dpkg --ignore-depends=baz --install foo.deb bar.deb


                          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 fool apt



                          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.






                          share|improve this answer

























                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            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




                            Boost.Python is a separately-compiled (as opposed to header-only) library




                            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 dependecies



                            If you don't want to build Boost.Python yourself, you can bypass apt (and its dependencies cheking) with dpkg.



                            Let's say you want to install a package named foo which depends on bar and baz, but you don't actually need baz.



                            apt download foo bar
                            sudo dpkg --ignore-depends=baz --install foo.deb bar.deb


                            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 fool apt



                            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.






                            share|improve this answer














                            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




                            Boost.Python is a separately-compiled (as opposed to header-only) library




                            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 dependecies



                            If you don't want to build Boost.Python yourself, you can bypass apt (and its dependencies cheking) with dpkg.



                            Let's say you want to install a package named foo which depends on bar and baz, but you don't actually need baz.



                            apt download foo bar
                            sudo dpkg --ignore-depends=baz --install foo.deb bar.deb


                            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 fool apt



                            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.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 22 at 9:55

























                            answered Nov 20 at 17:26









                            francescop21

                            11817




                            11817






















                                up vote
                                0
                                down vote













                                due to my research, it's not possible



                                libboost-python-dev package has libboost-python1.67-dev dependency.



                                https://packages.debian.org/sid/libboost-python-dev



                                and libboost-python1.67-dev has python-dev dependency which uses python 2



                                https://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 and rpm base distros.






                                share|improve this answer

























                                  up vote
                                  0
                                  down vote













                                  due to my research, it's not possible



                                  libboost-python-dev package has libboost-python1.67-dev dependency.



                                  https://packages.debian.org/sid/libboost-python-dev



                                  and libboost-python1.67-dev has python-dev dependency which uses python 2



                                  https://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 and rpm base distros.






                                  share|improve this answer























                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    due to my research, it's not possible



                                    libboost-python-dev package has libboost-python1.67-dev dependency.



                                    https://packages.debian.org/sid/libboost-python-dev



                                    and libboost-python1.67-dev has python-dev dependency which uses python 2



                                    https://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 and rpm base distros.






                                    share|improve this answer












                                    due to my research, it's not possible



                                    libboost-python-dev package has libboost-python1.67-dev dependency.



                                    https://packages.debian.org/sid/libboost-python-dev



                                    and libboost-python1.67-dev has python-dev dependency which uses python 2



                                    https://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 and rpm base distros.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 20 at 18:09









                                    mahradbt

                                    212




                                    212






















                                        up vote
                                        -2
                                        down vote













                                        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






                                        share|improve this answer

















                                        • 2




                                          Homebrew on Ubuntu??
                                          – Leopd
                                          Nov 19 at 19:48















                                        up vote
                                        -2
                                        down vote













                                        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






                                        share|improve this answer

















                                        • 2




                                          Homebrew on Ubuntu??
                                          – Leopd
                                          Nov 19 at 19:48













                                        up vote
                                        -2
                                        down vote










                                        up vote
                                        -2
                                        down vote









                                        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






                                        share|improve this answer












                                        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







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Aug 9 '17 at 17:34









                                        envy_intelligence

                                        1073




                                        1073








                                        • 2




                                          Homebrew on Ubuntu??
                                          – Leopd
                                          Nov 19 at 19:48














                                        • 2




                                          Homebrew on Ubuntu??
                                          – Leopd
                                          Nov 19 at 19:48








                                        2




                                        2




                                        Homebrew on Ubuntu??
                                        – Leopd
                                        Nov 19 at 19:48




                                        Homebrew on Ubuntu??
                                        – Leopd
                                        Nov 19 at 19:48


















                                         

                                        draft saved


                                        draft discarded



















































                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f944035%2finstalling-libboost-python-dev-for-python3-without-installing-python2-7%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        How to change which sound is reproduced for terminal bell?

                                        Can I use Tabulator js library in my java Spring + Thymeleaf project?

                                        Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents