How to upgrade python version on Ubuntu - python

I'm using Ubuntu 14.0.4. In my system I have installed Anaconda with python 2.7.14. Now I want to upgrade my python version & would like to use Python 3.6.3. So I followed the steps mentioned in below link
Update python on linux 2.7 to 3.5
But after doing this my python --version command is showing python 2.7.14. Can you suggest me how to upgrade?

It's a little bit tricky with Anaconda.
You need to do this within your Anaconda environment:
conda install python=3.6.3

Related

Python version different with anaconda version

I'm using python 3.9.0 and I want to install Anaconda, but the Anaconda not support python 3.9 yet. Is it okay if I'm still installing Anaconda ?
Anaconda actually comes with its own bundled Python and its package libraries. It is still okay if you already have Python installed on your machine.
If Python 3.9 is not necessary for your application, you can use Anaconda bundled Python version i.e Python 3.8 (latest version as now).
You can run your Python script using Anaconda virtual environment, so you will not mess up with existing Python installation.

Is Anaconda overriding my python version?

I am trying to run the latest version of python. I downloaded the latest version of python off the website. When I run the following line of code I see an Anaconda version:
python --version
Python 3.6.10 :: Anaconda, Inc.
I feel that the problem is that it is using an Anaconda version. How do I navigate out of this to the latest version?
I am using a Mac
I went online and realized I had to deactivate conda with the following line:
conda deactivate

How to find python version in anaconda continuum repo?

TensorFlow is not working in python 3.7, I wish to install anaconda with python 3.6.9, in the https://repo.continuum.io/archive/ I couldn't find which version, also the https://www.anaconda.com/distribution/#download-section having only for python 3.7.
How to find Anaconda2-5.3.1-Windows-x86.exe (in the archive) having which version of python. Looking for Windows
I am not looking to create conda env for python 3.6
By default, the detailed version is not supported.
If you want Python in version 3.6.9 (with Anaconda)
I recommend to install version 3.6. (I know you don't want...)
This seems to be a policy implemented by the Anaconda side for version-specific management.
By default Anaconda comes with Python 3.7.3, I installed that. Spyder opens with 3.7, Then in Anaconda Prompt, conda version is 4.7.10, with this Python downgrade it is not supported properly:
conda update conda
gives 4.7.11, then
conda install python=3.6.9
installs Python 3.6.9 smoothly, Spyder opens with 3.6,
Now TensorFlow works like a charm

How to Set Default Version of Python to 3.x vs 2.7 on Mac OSX?

I am attempting to install django framework using pip install -e django/, however, it requires Python 3.5+. Mac OSX by default comes with Python 2.7 so I have installed Python 3.6.5 from the python website.
I have confirmed the latest version of Python is installed through python3 .
I am still unable to install Django likely because Python 2.7 is also installed and seen first by pip.
Is it necessary to remove Python 2.7 from my system or can I modify PYTHON_HOME to achieve what I would like to do?
You can install to python 3 using
pip3 install django
python3 -m pip install django
As abarnert says in the comments, you shouldn't remove the Python 2.7 installation or try to set Python 3 to be the default.
It's good practice to use a virtual environment. Since you're using Python 3 you could use pipenv. Once the Python 3 virtual environment is activated, python will use the python 3 from the virtual environment.

Python environment on Ubuntu 15.04

I am not familiar with the linux system and I have already uninstalled Ubuntu 15.04 for 5 times due to improper operation. Please forgive it if my question is some kindly stupid or too easy for you because I really do not want to uninstall Ubuntu again.
There are few question I really need to make clear.
1) On Ubuntu 15.04, the default python is 2.7.9. Now I need to use jupyter notebook so that I choose to install Anaconda. The latest version of anaconda is for python 2.7.11. So do I need to update my default python version to 2.7.11 so that I can use jupyter notebook rightly? Because after I installed the Anaconda for python 2.7.11, the jupyter notebook could not new a python2 script. Hence should I turn to the Anaconda for python 2.7.9?
2) Questions about how to update the python version of Ubuntu exist a lot but I need to make sure what is the rightest and newest one because python is changing everyday.
In this stackoverflow question The Python 2.7 on Ubuntu, this method is recommended the most.
$ python -V
Python 2.6.6
$ curl -kL https://raw.github.com/utahta/pythonbrew/master/pythonbrew- install | bash
$ . $HOME/.pythonbrew/etc/bashrc
$ pythonbrew install 2.7.1
$ pythonbrew switch 2.7.1
Switched to Python-2.7.1
$ python -V
Python 2.7.1
But I saw the comment "should probably use pyenv instead of pythonbrew". So, if I need to work on multi-python environment, is pyenv the newest and most recommended one?
3) If I want to choose the easiest method so that I could use jupyter notebook rightly, is the anaconda for python 2.7.9 the most recommended choice?
Thank you all a lot!
If I understand you right, what are you trying to do is to update Ubuntu's system package.
What I did in the past is I have downloaded newest python, compiled it on my own and then started virtualenv that was using this freshly compiled python. However this process is a bit cumbersome and error prone.
I checked pyenv and pyenv-virtualenv, I think you should try it ( especially later one).
However perhaps Anacodna will work with python 2.7.9 and there is no need to update anything? In general difference between version 2.7.11 and 2.7.9 should be very minor.

Categories