Ubuntu 16.04 VIM without python support!












22















Although Ubuntu 16.04 release notes mention that:



The default VIM package has been built against python3 instead of python2.



Yet after I installed vim with the following command:



sudo apt-get install vim


And checked:



vim --version


It showed:



-python
-python3


Is it a bug? How do I get vim with Python support?










share|improve this question





























    22















    Although Ubuntu 16.04 release notes mention that:



    The default VIM package has been built against python3 instead of python2.



    Yet after I installed vim with the following command:



    sudo apt-get install vim


    And checked:



    vim --version


    It showed:



    -python
    -python3


    Is it a bug? How do I get vim with Python support?










    share|improve this question



























      22












      22








      22


      4






      Although Ubuntu 16.04 release notes mention that:



      The default VIM package has been built against python3 instead of python2.



      Yet after I installed vim with the following command:



      sudo apt-get install vim


      And checked:



      vim --version


      It showed:



      -python
      -python3


      Is it a bug? How do I get vim with Python support?










      share|improve this question
















      Although Ubuntu 16.04 release notes mention that:



      The default VIM package has been built against python3 instead of python2.



      Yet after I installed vim with the following command:



      sudo apt-get install vim


      And checked:



      vim --version


      It showed:



      -python
      -python3


      Is it a bug? How do I get vim with Python support?







      apt python 16.04 vim python3






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 21 '17 at 11:10









      Zanna

      50.7k13135241




      50.7k13135241










      asked Apr 29 '16 at 10:47









      Saprativa BhattacharjeeSaprativa Bhattacharjee

      5423610




      5423610






















          5 Answers
          5






          active

          oldest

          votes


















          27














          If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox) see edit below.



          However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).



          Edit: vim was recently updated to fix this issue, and you should not need to install the vim-nox package anymore to get Python 3 support.






          share|improve this answer





















          • 1





            yeah i did that..but why is the vim package not supporting python?

            – Saprativa Bhattacharjee
            Apr 30 '16 at 5:43











          • Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

            – saiarcot895
            Apr 30 '16 at 12:44






          • 1





            isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

            – Saprativa Bhattacharjee
            May 1 '16 at 7:33













          • @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

            – qweruiop
            Jun 14 '16 at 14:25






          • 2





            Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

            – DBS
            Oct 14 '16 at 0:52



















          2














          Try installing vim-gnome instead of vim.



          sudo apt-get install vim-gnome


          If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support
          Open a terminal in same folder and install with:



          dpkg -i python-support_X.X.X_all.deb


          See if it helps






          share|improve this answer
























          • is that a gui version?

            – Saprativa Bhattacharjee
            Apr 30 '16 at 5:43



















          2














          In 17.10-18.10 it is difficult to get a copy of vim with both python2 and python3 support. The PPA setup by pi-rho has such packages for previous releases, but nothing yet for 17.10 and later.



          This is what I did to get pi-rho packages running:




          1. uninstall all vim packages (this will force you to uninstall "ubuntu-minimal")

          2. download the vim packages from here that end in a "~z"

          3. download the packages perl-modules-5.24,libgdbm3, and libperl5.24

          4. install them using dpkg: go to the download directory and do sudo dpkg -i libgdbm3_1.8.3-14_amd64.deb libperl5.24_5.24.1-2ubuntu1.1_amd64.deb perl-modules-5.24_5.24.1-2ubuntu1.1_all.deb vim*.deb

          5. reinstall "ubuntu-minimal": sudo apt install ubuntu-minimal

          6. lock the vim version


            • open synaptic package manager and highlight the vim packages you just installed. Go to Package->"Lock Version"

            • you may also need to "hold" the packages with sudo apt-mark hold for each of those packages (e.g. sudo apt-mark hold vim-common vim-gnome)








          share|improve this answer

































            1














            On Ubuntu 17.10, compiling is the solution that worked for me:



            Directly inspired by this gist, I did the following:



            sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
            sudo apt-get install checkinstall
            sudo rm -rf /usr/local/share/vim /usr/bin/vim
            cd /tmp && git clone https://github.com/vim/vim
            cd vim/src
            make distclean
            cd ..
            ./configure --enable-multibyte --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-cscope --enable-gui=auto --with-features=huge --with-x --enable-fontset --enable-largefile --disable-netbeans --with-compiledby="put your name here" --enable-fail-if-missing
            make
            sudo make install
            sudo ln -s /usr/local/bin/vim /usr/bin/vim


            Don't forget to adapt the ./configure parameters so you have all the other features you need.



            Now you can open vim and run the command :echo has('python') to confirm you have python 2 enabled.






            share|improve this answer































              0














              Installing vim-nox-py2 and then running



              sudo update-alternatives --config vim


              worked for me.






              share|improve this answer

























                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',
                autoActivateHeartbeat: false,
                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%2f764882%2fubuntu-16-04-vim-without-python-support%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                27














                If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox) see edit below.



                However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).



                Edit: vim was recently updated to fix this issue, and you should not need to install the vim-nox package anymore to get Python 3 support.






                share|improve this answer





















                • 1





                  yeah i did that..but why is the vim package not supporting python?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43











                • Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                  – saiarcot895
                  Apr 30 '16 at 12:44






                • 1





                  isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                  – Saprativa Bhattacharjee
                  May 1 '16 at 7:33













                • @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                  – qweruiop
                  Jun 14 '16 at 14:25






                • 2





                  Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                  – DBS
                  Oct 14 '16 at 0:52
















                27














                If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox) see edit below.



                However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).



                Edit: vim was recently updated to fix this issue, and you should not need to install the vim-nox package anymore to get Python 3 support.






                share|improve this answer





















                • 1





                  yeah i did that..but why is the vim package not supporting python?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43











                • Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                  – saiarcot895
                  Apr 30 '16 at 12:44






                • 1





                  isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                  – Saprativa Bhattacharjee
                  May 1 '16 at 7:33













                • @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                  – qweruiop
                  Jun 14 '16 at 14:25






                • 2





                  Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                  – DBS
                  Oct 14 '16 at 0:52














                27












                27








                27







                If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox) see edit below.



                However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).



                Edit: vim was recently updated to fix this issue, and you should not need to install the vim-nox package anymore to get Python 3 support.






                share|improve this answer















                If you want Python 3 support in vim, install the vim-nox package (sudo apt install vim-nox) see edit below.



                However, if you still need Python 2 support, install the vim-nox-py2 package (sudo apt install vim-nox-py2).



                Edit: vim was recently updated to fix this issue, and you should not need to install the vim-nox package anymore to get Python 3 support.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jul 1 '16 at 1:40

























                answered Apr 29 '16 at 23:29









                saiarcot895saiarcot895

                9,46422333




                9,46422333








                • 1





                  yeah i did that..but why is the vim package not supporting python?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43











                • Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                  – saiarcot895
                  Apr 30 '16 at 12:44






                • 1





                  isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                  – Saprativa Bhattacharjee
                  May 1 '16 at 7:33













                • @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                  – qweruiop
                  Jun 14 '16 at 14:25






                • 2





                  Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                  – DBS
                  Oct 14 '16 at 0:52














                • 1





                  yeah i did that..but why is the vim package not supporting python?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43











                • Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                  – saiarcot895
                  Apr 30 '16 at 12:44






                • 1





                  isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                  – Saprativa Bhattacharjee
                  May 1 '16 at 7:33













                • @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                  – qweruiop
                  Jun 14 '16 at 14:25






                • 2





                  Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                  – DBS
                  Oct 14 '16 at 0:52








                1




                1





                yeah i did that..but why is the vim package not supporting python?

                – Saprativa Bhattacharjee
                Apr 30 '16 at 5:43





                yeah i did that..but why is the vim package not supporting python?

                – Saprativa Bhattacharjee
                Apr 30 '16 at 5:43













                Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                – saiarcot895
                Apr 30 '16 at 12:44





                Ubuntu split the Python support from the main package into two other packages: one that supports Python 2 and one that supports Python 3. After you install one of the above packages, you should be able to use vim with Python 2/3 support.

                – saiarcot895
                Apr 30 '16 at 12:44




                1




                1





                isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                – Saprativa Bhattacharjee
                May 1 '16 at 7:33







                isn't it surprising that the vim package itself doesn't support any of the pythons? the release notes mention otherwise. wiki.ubuntu.com/XenialXerus/ReleaseNotes

                – Saprativa Bhattacharjee
                May 1 '16 at 7:33















                @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                – qweruiop
                Jun 14 '16 at 14:25





                @saiarcot895 This apparently works for me. But where did you dig this info up? Is there a Ubuntu wiki documenting how they distribute stuff?

                – qweruiop
                Jun 14 '16 at 14:25




                2




                2





                Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                – DBS
                Oct 14 '16 at 0:52





                Just wanted to add that after installing vim-nox-py2 I needed to run sudo update-alternatives --set vim /usr/bin/vim.nox-py2. I believe, please correct me otherwise, without this vim points to vim.tiny or some such package which doesn't have python support.

                – DBS
                Oct 14 '16 at 0:52













                2














                Try installing vim-gnome instead of vim.



                sudo apt-get install vim-gnome


                If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support
                Open a terminal in same folder and install with:



                dpkg -i python-support_X.X.X_all.deb


                See if it helps






                share|improve this answer
























                • is that a gui version?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43
















                2














                Try installing vim-gnome instead of vim.



                sudo apt-get install vim-gnome


                If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support
                Open a terminal in same folder and install with:



                dpkg -i python-support_X.X.X_all.deb


                See if it helps






                share|improve this answer
























                • is that a gui version?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43














                2












                2








                2







                Try installing vim-gnome instead of vim.



                sudo apt-get install vim-gnome


                If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support
                Open a terminal in same folder and install with:



                dpkg -i python-support_X.X.X_all.deb


                See if it helps






                share|improve this answer













                Try installing vim-gnome instead of vim.



                sudo apt-get install vim-gnome


                If that can help, you can install the package python-support by downloading the latest version of python-support_X.X.X_all.deb there : https://launchpad.net/ubuntu/+source/python-support
                Open a terminal in same folder and install with:



                dpkg -i python-support_X.X.X_all.deb


                See if it helps







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 29 '16 at 12:19









                FluffyFluffy

                226210




                226210













                • is that a gui version?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43



















                • is that a gui version?

                  – Saprativa Bhattacharjee
                  Apr 30 '16 at 5:43

















                is that a gui version?

                – Saprativa Bhattacharjee
                Apr 30 '16 at 5:43





                is that a gui version?

                – Saprativa Bhattacharjee
                Apr 30 '16 at 5:43











                2














                In 17.10-18.10 it is difficult to get a copy of vim with both python2 and python3 support. The PPA setup by pi-rho has such packages for previous releases, but nothing yet for 17.10 and later.



                This is what I did to get pi-rho packages running:




                1. uninstall all vim packages (this will force you to uninstall "ubuntu-minimal")

                2. download the vim packages from here that end in a "~z"

                3. download the packages perl-modules-5.24,libgdbm3, and libperl5.24

                4. install them using dpkg: go to the download directory and do sudo dpkg -i libgdbm3_1.8.3-14_amd64.deb libperl5.24_5.24.1-2ubuntu1.1_amd64.deb perl-modules-5.24_5.24.1-2ubuntu1.1_all.deb vim*.deb

                5. reinstall "ubuntu-minimal": sudo apt install ubuntu-minimal

                6. lock the vim version


                  • open synaptic package manager and highlight the vim packages you just installed. Go to Package->"Lock Version"

                  • you may also need to "hold" the packages with sudo apt-mark hold for each of those packages (e.g. sudo apt-mark hold vim-common vim-gnome)








                share|improve this answer






























                  2














                  In 17.10-18.10 it is difficult to get a copy of vim with both python2 and python3 support. The PPA setup by pi-rho has such packages for previous releases, but nothing yet for 17.10 and later.



                  This is what I did to get pi-rho packages running:




                  1. uninstall all vim packages (this will force you to uninstall "ubuntu-minimal")

                  2. download the vim packages from here that end in a "~z"

                  3. download the packages perl-modules-5.24,libgdbm3, and libperl5.24

                  4. install them using dpkg: go to the download directory and do sudo dpkg -i libgdbm3_1.8.3-14_amd64.deb libperl5.24_5.24.1-2ubuntu1.1_amd64.deb perl-modules-5.24_5.24.1-2ubuntu1.1_all.deb vim*.deb

                  5. reinstall "ubuntu-minimal": sudo apt install ubuntu-minimal

                  6. lock the vim version


                    • open synaptic package manager and highlight the vim packages you just installed. Go to Package->"Lock Version"

                    • you may also need to "hold" the packages with sudo apt-mark hold for each of those packages (e.g. sudo apt-mark hold vim-common vim-gnome)








                  share|improve this answer




























                    2












                    2








                    2







                    In 17.10-18.10 it is difficult to get a copy of vim with both python2 and python3 support. The PPA setup by pi-rho has such packages for previous releases, but nothing yet for 17.10 and later.



                    This is what I did to get pi-rho packages running:




                    1. uninstall all vim packages (this will force you to uninstall "ubuntu-minimal")

                    2. download the vim packages from here that end in a "~z"

                    3. download the packages perl-modules-5.24,libgdbm3, and libperl5.24

                    4. install them using dpkg: go to the download directory and do sudo dpkg -i libgdbm3_1.8.3-14_amd64.deb libperl5.24_5.24.1-2ubuntu1.1_amd64.deb perl-modules-5.24_5.24.1-2ubuntu1.1_all.deb vim*.deb

                    5. reinstall "ubuntu-minimal": sudo apt install ubuntu-minimal

                    6. lock the vim version


                      • open synaptic package manager and highlight the vim packages you just installed. Go to Package->"Lock Version"

                      • you may also need to "hold" the packages with sudo apt-mark hold for each of those packages (e.g. sudo apt-mark hold vim-common vim-gnome)








                    share|improve this answer















                    In 17.10-18.10 it is difficult to get a copy of vim with both python2 and python3 support. The PPA setup by pi-rho has such packages for previous releases, but nothing yet for 17.10 and later.



                    This is what I did to get pi-rho packages running:




                    1. uninstall all vim packages (this will force you to uninstall "ubuntu-minimal")

                    2. download the vim packages from here that end in a "~z"

                    3. download the packages perl-modules-5.24,libgdbm3, and libperl5.24

                    4. install them using dpkg: go to the download directory and do sudo dpkg -i libgdbm3_1.8.3-14_amd64.deb libperl5.24_5.24.1-2ubuntu1.1_amd64.deb perl-modules-5.24_5.24.1-2ubuntu1.1_all.deb vim*.deb

                    5. reinstall "ubuntu-minimal": sudo apt install ubuntu-minimal

                    6. lock the vim version


                      • open synaptic package manager and highlight the vim packages you just installed. Go to Package->"Lock Version"

                      • you may also need to "hold" the packages with sudo apt-mark hold for each of those packages (e.g. sudo apt-mark hold vim-common vim-gnome)









                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Jan 4 at 13:45

























                    answered Dec 4 '17 at 8:58









                    krumpelstiltskinkrumpelstiltskin

                    1,17721325




                    1,17721325























                        1














                        On Ubuntu 17.10, compiling is the solution that worked for me:



                        Directly inspired by this gist, I did the following:



                        sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
                        sudo apt-get install checkinstall
                        sudo rm -rf /usr/local/share/vim /usr/bin/vim
                        cd /tmp && git clone https://github.com/vim/vim
                        cd vim/src
                        make distclean
                        cd ..
                        ./configure --enable-multibyte --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-cscope --enable-gui=auto --with-features=huge --with-x --enable-fontset --enable-largefile --disable-netbeans --with-compiledby="put your name here" --enable-fail-if-missing
                        make
                        sudo make install
                        sudo ln -s /usr/local/bin/vim /usr/bin/vim


                        Don't forget to adapt the ./configure parameters so you have all the other features you need.



                        Now you can open vim and run the command :echo has('python') to confirm you have python 2 enabled.






                        share|improve this answer




























                          1














                          On Ubuntu 17.10, compiling is the solution that worked for me:



                          Directly inspired by this gist, I did the following:



                          sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
                          sudo apt-get install checkinstall
                          sudo rm -rf /usr/local/share/vim /usr/bin/vim
                          cd /tmp && git clone https://github.com/vim/vim
                          cd vim/src
                          make distclean
                          cd ..
                          ./configure --enable-multibyte --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-cscope --enable-gui=auto --with-features=huge --with-x --enable-fontset --enable-largefile --disable-netbeans --with-compiledby="put your name here" --enable-fail-if-missing
                          make
                          sudo make install
                          sudo ln -s /usr/local/bin/vim /usr/bin/vim


                          Don't forget to adapt the ./configure parameters so you have all the other features you need.



                          Now you can open vim and run the command :echo has('python') to confirm you have python 2 enabled.






                          share|improve this answer


























                            1












                            1








                            1







                            On Ubuntu 17.10, compiling is the solution that worked for me:



                            Directly inspired by this gist, I did the following:



                            sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
                            sudo apt-get install checkinstall
                            sudo rm -rf /usr/local/share/vim /usr/bin/vim
                            cd /tmp && git clone https://github.com/vim/vim
                            cd vim/src
                            make distclean
                            cd ..
                            ./configure --enable-multibyte --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-cscope --enable-gui=auto --with-features=huge --with-x --enable-fontset --enable-largefile --disable-netbeans --with-compiledby="put your name here" --enable-fail-if-missing
                            make
                            sudo make install
                            sudo ln -s /usr/local/bin/vim /usr/bin/vim


                            Don't forget to adapt the ./configure parameters so you have all the other features you need.



                            Now you can open vim and run the command :echo has('python') to confirm you have python 2 enabled.






                            share|improve this answer













                            On Ubuntu 17.10, compiling is the solution that worked for me:



                            Directly inspired by this gist, I did the following:



                            sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
                            sudo apt-get install checkinstall
                            sudo rm -rf /usr/local/share/vim /usr/bin/vim
                            cd /tmp && git clone https://github.com/vim/vim
                            cd vim/src
                            make distclean
                            cd ..
                            ./configure --enable-multibyte --enable-perlinterp=dynamic --enable-pythoninterp=dynamic --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu --enable-cscope --enable-gui=auto --with-features=huge --with-x --enable-fontset --enable-largefile --disable-netbeans --with-compiledby="put your name here" --enable-fail-if-missing
                            make
                            sudo make install
                            sudo ln -s /usr/local/bin/vim /usr/bin/vim


                            Don't forget to adapt the ./configure parameters so you have all the other features you need.



                            Now you can open vim and run the command :echo has('python') to confirm you have python 2 enabled.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Feb 7 '18 at 15:55









                            vtelliervtellier

                            17115




                            17115























                                0














                                Installing vim-nox-py2 and then running



                                sudo update-alternatives --config vim


                                worked for me.






                                share|improve this answer






























                                  0














                                  Installing vim-nox-py2 and then running



                                  sudo update-alternatives --config vim


                                  worked for me.






                                  share|improve this answer




























                                    0












                                    0








                                    0







                                    Installing vim-nox-py2 and then running



                                    sudo update-alternatives --config vim


                                    worked for me.






                                    share|improve this answer















                                    Installing vim-nox-py2 and then running



                                    sudo update-alternatives --config vim


                                    worked for me.







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Apr 14 '18 at 19:41









                                    Zanna

                                    50.7k13135241




                                    50.7k13135241










                                    answered Apr 14 '18 at 19:01









                                    Jemshid KKJemshid KK

                                    214




                                    214






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Ask Ubuntu!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f764882%2fubuntu-16-04-vim-without-python-support%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

                                        Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                                        ComboBox Display Member on multiple fields

                                        Is it possible to collect Nectar points via Trainline?