Upgrading python version

I have downloaded and install python 3.7 but when i check the current version it always shows 2.7
How can i completely get rid of the old version and have 3.7 running.
Also I would like to have python3 running on jupyter notebook. How do I do that?

Hi @yasirqureshi23028539.

Unfortunately, I do not know the answer to the first question. But you can read this article to learn how to have Python 3 running on a Jupyter Notebook. I hope you can solve your problems.

Happy coding! :wave:

1 Like

There’s a good chance you can’t remove it (without serious consequences) as the original version is probably used by your operating system (Ubuntu in your case, I think) and you’re likely to muck up a number of dependencies. I’m pretty sure that’s still the case.

If you’re having problems with different versions there’s already a great solution to this, since it happens so often, virtual environments. Look up how to create and use a virtual environment and it may simplify what you’re doing now and is likely to be even more useful in the future when various packages start having verisioning and dependence issues.

1 Like

Hi there, and welcome to the forums!

@tgrtim is correct when they say this:

I am guessing, since your computer’s name is Yasirs-MBP that you’re using a MacBook Pro?

Regardless, if your operating system has shipped with some variant of Python installed then you’re best not removing it in case it’s used somewhere by the OS.

The reason that you’re seeing the behaviour you’re seeing is because, by default, invoking python on the command line uses Python 2.

To run Python 3, you need to use the (hopefully obvious) python3 on the command line.

If you want to have Python 3 run as the “default”, this article may help you out.

1 Like