-1

I am using Ubuntu 14.04 and python 2.7.6 installed by default to It. I want to install flask framework to this computer and make project.Is It OK to use old version of python.If I uninstall python 2.7.6 it hurm to Ubuntu,Because more modules written in python 2.7.6.I installed new version python for example python 3.7 but anyway python --version command shows

python 2.7.6

But whereis python shows

python: /usr/bin/python3.7m /usr/bin/python3.7 /usr/bin/python2.7 /usr/bin/python /etc/python3.7 /etc/python2.7 /etc/python /usr/lib/python3.7 /usr/lib/python2.7 /usr/local/lib/python2.7 /usr/local/lib/python3.7 /usr/share/python /usr/share/man/man1/python.1.gz

If I uninstall python 2.7.6. Does it break ubuntu ? Any suggestions ? Thank you !

  • 1
    I believe this is off topic here. You can definitely have two versions of Python installed, but you may have to edit paths to use the newer version. You should google “virtual environment Python”. docs.python.org/3/tutorial/venv.html – Eric S Aug 1 '19 at 13:56
1

You can have both python and python3 installed at the same time. In Ubuntu, python3 is usually started with "python3" at the command line. To install new libraries, use pip3, etc. Not sure when Ubuntu started coming with both versions - pretty sure it was before 14 though.

Virtual environments as suggested by Eric Shain are a convenient option to use both versions alongside each other.

All the major libraries have now been ported to Python3 - I would strongly recommend using Python 3 for all new development unless you have a very good reason (ie. a legacy library that has not been ported). Some libraries are already stopping support of their old Python 2 versions - no doubt this will accelerate.

You may want to also investigate packages such as anaconda. I had to do this for a book I was reviewing and it looks like it installed python3 to the "python" command line...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy