How to install python2.7 in Ubuntu 16.04

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
2
down vote

favorite














I'm trying to install Python 2.7 on Ubuntu 16.04.
When I trype python or python2 or python2.7, I get the following message:



 The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>


After running sudo apt install python2.7, I get the following message but python is still unavailable when I type python.



Reading package lists... Done Building dependency tree Reading state
information... Done You might want to run 'apt-get -f install' to
correct these: The following packages have unmet dependencies:
mongodb-compass : Depends: gvfs-bin
Depends: python but it is not going to be installed
python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).


I also tried:



  • sudo apt install python

  • sudo apt install python2.7

  • sudo apt install python2

  • sudo apt-get install python

  • sudo apt-get install python 2.7

  • sudo apt-get install python2

Nothing have worked till now.



I can access Python3.5 by just typing python3, but I need python2.7.
I updated the repository before trying to install python. What am I doing wrong?



Update



Running cache policy for python:



python2.7:
Installed: (none)
Candidate: 2.7.12-1ubuntu0~16.04.3
Version table:
2.7.12-1ubuntu0~16.04.3 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
2.7.12-1ubuntu0~16.04.2 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.7.11-7ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages


Running cache policy for mongodb:



mongodb-compass:
Installed: 1.6.0-1
Candidate: 1.6.0-1
Version table:
*** 1.6.0-1 100
100 /var/lib/dpkg/status









share|improve this question























  • Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
    – N0rbert
    Feb 1 at 21:35










  • You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
    – N0rbert
    Feb 1 at 21:38











  • Sorry about that, I'm using ubuntu 16.04. I edited my question
    – Raven
    Feb 1 at 21:41










  • What is the output of apt-cache policy mongodb-compass?
    – N0rbert
    Feb 1 at 21:43










  • Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
    – N0rbert
    Feb 1 at 21:45














up vote
2
down vote

favorite














I'm trying to install Python 2.7 on Ubuntu 16.04.
When I trype python or python2 or python2.7, I get the following message:



 The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>


After running sudo apt install python2.7, I get the following message but python is still unavailable when I type python.



Reading package lists... Done Building dependency tree Reading state
information... Done You might want to run 'apt-get -f install' to
correct these: The following packages have unmet dependencies:
mongodb-compass : Depends: gvfs-bin
Depends: python but it is not going to be installed
python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).


I also tried:



  • sudo apt install python

  • sudo apt install python2.7

  • sudo apt install python2

  • sudo apt-get install python

  • sudo apt-get install python 2.7

  • sudo apt-get install python2

Nothing have worked till now.



I can access Python3.5 by just typing python3, but I need python2.7.
I updated the repository before trying to install python. What am I doing wrong?



Update



Running cache policy for python:



python2.7:
Installed: (none)
Candidate: 2.7.12-1ubuntu0~16.04.3
Version table:
2.7.12-1ubuntu0~16.04.3 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
2.7.12-1ubuntu0~16.04.2 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.7.11-7ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages


Running cache policy for mongodb:



mongodb-compass:
Installed: 1.6.0-1
Candidate: 1.6.0-1
Version table:
*** 1.6.0-1 100
100 /var/lib/dpkg/status









share|improve this question























  • Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
    – N0rbert
    Feb 1 at 21:35










  • You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
    – N0rbert
    Feb 1 at 21:38











  • Sorry about that, I'm using ubuntu 16.04. I edited my question
    – Raven
    Feb 1 at 21:41










  • What is the output of apt-cache policy mongodb-compass?
    – N0rbert
    Feb 1 at 21:43










  • Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
    – N0rbert
    Feb 1 at 21:45












up vote
2
down vote

favorite









up vote
2
down vote

favorite













I'm trying to install Python 2.7 on Ubuntu 16.04.
When I trype python or python2 or python2.7, I get the following message:



 The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>


After running sudo apt install python2.7, I get the following message but python is still unavailable when I type python.



Reading package lists... Done Building dependency tree Reading state
information... Done You might want to run 'apt-get -f install' to
correct these: The following packages have unmet dependencies:
mongodb-compass : Depends: gvfs-bin
Depends: python but it is not going to be installed
python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).


I also tried:



  • sudo apt install python

  • sudo apt install python2.7

  • sudo apt install python2

  • sudo apt-get install python

  • sudo apt-get install python 2.7

  • sudo apt-get install python2

Nothing have worked till now.



I can access Python3.5 by just typing python3, but I need python2.7.
I updated the repository before trying to install python. What am I doing wrong?



Update



Running cache policy for python:



python2.7:
Installed: (none)
Candidate: 2.7.12-1ubuntu0~16.04.3
Version table:
2.7.12-1ubuntu0~16.04.3 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
2.7.12-1ubuntu0~16.04.2 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.7.11-7ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages


Running cache policy for mongodb:



mongodb-compass:
Installed: 1.6.0-1
Candidate: 1.6.0-1
Version table:
*** 1.6.0-1 100
100 /var/lib/dpkg/status









share|improve this question

















I'm trying to install Python 2.7 on Ubuntu 16.04.
When I trype python or python2 or python2.7, I get the following message:



 The program 'python' can be found in the following packages:
* python-minimal
* python3
Try: sudo apt install <selected package>


After running sudo apt install python2.7, I get the following message but python is still unavailable when I type python.



Reading package lists... Done Building dependency tree Reading state
information... Done You might want to run 'apt-get -f install' to
correct these: The following packages have unmet dependencies:
mongodb-compass : Depends: gvfs-bin
Depends: python but it is not going to be installed
python2.7 : Depends: python2.7-minimal (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
Depends: libpython2.7-stdlib (= 2.7.12-1ubuntu0~16.04.3) but
it is not going to be installed
E: Unmet dependencies.
Try 'apt-get -f install' with no packages (or specify a solution).


I also tried:



  • sudo apt install python

  • sudo apt install python2.7

  • sudo apt install python2

  • sudo apt-get install python

  • sudo apt-get install python 2.7

  • sudo apt-get install python2

Nothing have worked till now.



I can access Python3.5 by just typing python3, but I need python2.7.
I updated the repository before trying to install python. What am I doing wrong?



Update



Running cache policy for python:



python2.7:
Installed: (none)
Candidate: 2.7.12-1ubuntu0~16.04.3
Version table:
2.7.12-1ubuntu0~16.04.3 500
500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
2.7.12-1ubuntu0~16.04.2 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
2.7.11-7ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages


Running cache policy for mongodb:



mongodb-compass:
Installed: 1.6.0-1
Candidate: 1.6.0-1
Version table:
*** 1.6.0-1 100
100 /var/lib/dpkg/status






apt python dependencies






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 2 at 0:19









Chai T. Rex

3,81511132




3,81511132










asked Feb 1 at 21:31









Raven

1827




1827











  • Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
    – N0rbert
    Feb 1 at 21:35










  • You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
    – N0rbert
    Feb 1 at 21:38











  • Sorry about that, I'm using ubuntu 16.04. I edited my question
    – Raven
    Feb 1 at 21:41










  • What is the output of apt-cache policy mongodb-compass?
    – N0rbert
    Feb 1 at 21:43










  • Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
    – N0rbert
    Feb 1 at 21:45
















  • Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
    – N0rbert
    Feb 1 at 21:35










  • You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
    – N0rbert
    Feb 1 at 21:38











  • Sorry about that, I'm using ubuntu 16.04. I edited my question
    – Raven
    Feb 1 at 21:41










  • What is the output of apt-cache policy mongodb-compass?
    – N0rbert
    Feb 1 at 21:43










  • Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
    – N0rbert
    Feb 1 at 21:45















Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
– N0rbert
Feb 1 at 21:35




Please update your question with output of apt-cache policy python2.7. It seems that you have PPAs or third-party repositories. In Trusty python2.7 is packaged normally.
– N0rbert
Feb 1 at 21:35












You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
– N0rbert
Feb 1 at 21:38





You tagged question with 14.04 tag, but have Xenial repositories. I do not understand this. What is the output of cat /etc/os-release (add to question)?
– N0rbert
Feb 1 at 21:38













Sorry about that, I'm using ubuntu 16.04. I edited my question
– Raven
Feb 1 at 21:41




Sorry about that, I'm using ubuntu 16.04. I edited my question
– Raven
Feb 1 at 21:41












What is the output of apt-cache policy mongodb-compass?
– N0rbert
Feb 1 at 21:43




What is the output of apt-cache policy mongodb-compass?
– N0rbert
Feb 1 at 21:43












Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
– N0rbert
Feb 1 at 21:45




Try to remove it with sudo apt-get purge mongodb-compass. And retry python installation.
– N0rbert
Feb 1 at 21:45










2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










Try to remove mongodb-compass with



sudo apt-get purge mongodb-compass


Then check that everything is in place with



sudo apt-get install -f
sudo apt-get check





share|improve this answer




















  • Does that mean I've to install mongodb-compass again?
    – Raven
    Feb 1 at 21:51










  • You can install mongodb-compass if you need it. I do not know its source.
    – N0rbert
    Feb 1 at 21:52


















up vote
1
down vote













Try this simple command and get python 2.7 installed, thanks



sudo apt install python-minimal



and check the version you will get 2.7.X version (python -V)






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',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    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%2f1002190%2fhow-to-install-python2-7-in-ubuntu-16-04%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Try to remove mongodb-compass with



    sudo apt-get purge mongodb-compass


    Then check that everything is in place with



    sudo apt-get install -f
    sudo apt-get check





    share|improve this answer




















    • Does that mean I've to install mongodb-compass again?
      – Raven
      Feb 1 at 21:51










    • You can install mongodb-compass if you need it. I do not know its source.
      – N0rbert
      Feb 1 at 21:52















    up vote
    1
    down vote



    accepted










    Try to remove mongodb-compass with



    sudo apt-get purge mongodb-compass


    Then check that everything is in place with



    sudo apt-get install -f
    sudo apt-get check





    share|improve this answer




















    • Does that mean I've to install mongodb-compass again?
      – Raven
      Feb 1 at 21:51










    • You can install mongodb-compass if you need it. I do not know its source.
      – N0rbert
      Feb 1 at 21:52













    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    Try to remove mongodb-compass with



    sudo apt-get purge mongodb-compass


    Then check that everything is in place with



    sudo apt-get install -f
    sudo apt-get check





    share|improve this answer












    Try to remove mongodb-compass with



    sudo apt-get purge mongodb-compass


    Then check that everything is in place with



    sudo apt-get install -f
    sudo apt-get check






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 1 at 21:50









    N0rbert

    16.7k33479




    16.7k33479











    • Does that mean I've to install mongodb-compass again?
      – Raven
      Feb 1 at 21:51










    • You can install mongodb-compass if you need it. I do not know its source.
      – N0rbert
      Feb 1 at 21:52

















    • Does that mean I've to install mongodb-compass again?
      – Raven
      Feb 1 at 21:51










    • You can install mongodb-compass if you need it. I do not know its source.
      – N0rbert
      Feb 1 at 21:52
















    Does that mean I've to install mongodb-compass again?
    – Raven
    Feb 1 at 21:51




    Does that mean I've to install mongodb-compass again?
    – Raven
    Feb 1 at 21:51












    You can install mongodb-compass if you need it. I do not know its source.
    – N0rbert
    Feb 1 at 21:52





    You can install mongodb-compass if you need it. I do not know its source.
    – N0rbert
    Feb 1 at 21:52













    up vote
    1
    down vote













    Try this simple command and get python 2.7 installed, thanks



    sudo apt install python-minimal



    and check the version you will get 2.7.X version (python -V)






    share|improve this answer
























      up vote
      1
      down vote













      Try this simple command and get python 2.7 installed, thanks



      sudo apt install python-minimal



      and check the version you will get 2.7.X version (python -V)






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        Try this simple command and get python 2.7 installed, thanks



        sudo apt install python-minimal



        and check the version you will get 2.7.X version (python -V)






        share|improve this answer












        Try this simple command and get python 2.7 installed, thanks



        sudo apt install python-minimal



        and check the version you will get 2.7.X version (python -V)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 29 at 8:03









        Eeshwar Srujan

        111




        111



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1002190%2fhow-to-install-python2-7-in-ubuntu-16-04%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491