28

I am new to Python. I was asked to update to the latest Python version using conda.

So far, I have installed Anaconda on my Mac. So I am mainly using the Terminal.

Thank you in advance.

1
  • if you have latest version of anaconda, you might already have latest version of python.
    – Sociopath
    Aug 27, 2018 at 8:53

3 Answers 3

31

Without virtual environment or inside the environment, you can update python as follow:

conda update python

Or you can upgrade or downgrade the environment python version:

conda install python=3.7

Updating or Upgrading Python

0
17

Open conda shell prompt. (On Windows Anaconda Powershell Prompt)

You first check

conda search python

You will get all the supported versions. It may look like:

Loading channels: done
# Name                       Version           Build  Channel
python                        2.7.13     h1b6d89f_16  pkgs/main
python                        2.7.13     h9912b81_15  pkgs/main
python                        2.7.13     hb034564_12  pkgs/main
python                        2.7.14     h2765ee6_18  pkgs/main
python                        2.7.14     h3e68818_15  pkgs/main
python                        2.7.14     h4084c39_22  pkgs/main
python                        2.7.14     h4a10d90_30  pkgs/main
python                        2.7.14     h4a10d90_31  pkgs/main
python                        2.7.14     h59f5a59_20  pkgs/main
python                        2.7.14     h819644d_16  pkgs/main
python                        2.7.14     h8c3f1cb_23  pkgs/main
python                        2.7.15      h2880e7c_2  pkgs/main
python                        2.7.15      h2880e7c_3  pkgs/main
python                        2.7.15      h2880e7c_4  pkgs/main
python                        2.7.15     hcb6e200_15  pkgs/main
python                        2.7.15      hcb6e200_5  pkgs/main
python                        2.7.15      hcb6e200_7  pkgs/main
python                        2.7.15      he216670_0  pkgs/main
python                        2.7.16      hcb6e200_0  pkgs/main
python                        2.7.17      h930f6bb_0  pkgs/main
python                         3.5.4     h1357f44_23  pkgs/main
python                         3.5.4     hc495aa9_21  pkgs/main
python                         3.5.4     hd3c4935_11  pkgs/main
python                         3.5.4     hdec4e59_20  pkgs/main
python                         3.5.4     hedc2606_15  pkgs/main
python                         3.5.5      h0c2934d_0  pkgs/main
python                         3.5.5      h0c2934d_1  pkgs/main
python                         3.5.5      h0c2934d_2  pkgs/main
python                         3.5.6      he025d50_0  pkgs/main
python                         3.6.2     h09676a0_15  pkgs/main
python                         3.6.2     h6679aeb_11  pkgs/main
python                         3.6.3      h210ce5f_2  pkgs/main
python                         3.6.3      h3389d20_0  pkgs/main
python                         3.6.3      h3b118a2_4  pkgs/main
python                         3.6.3      h9e2ca53_1  pkgs/main
python                         3.6.4      h0c2934d_2  pkgs/main
python                         3.6.4      h0c2934d_3  pkgs/main
python                         3.6.4      h6538335_0  pkgs/main
python                         3.6.4      h6538335_1  pkgs/main
python                         3.6.5      h0c2934d_0  pkgs/main
python                         3.6.6      hea74fb7_0  pkgs/main
python                         3.6.7      h33f27b4_0  pkgs/main
python                         3.6.7      h33f27b4_1  pkgs/main
python                         3.6.7      h9f7ef89_2  pkgs/main
python                         3.6.8      h9f7ef89_0  pkgs/main
python                         3.6.8      h9f7ef89_1  pkgs/main
python                         3.6.8      h9f7ef89_7  pkgs/main
python                         3.6.9      h5500b2f_0  pkgs/main
python                         3.7.0      hea74fb7_0  pkgs/main
python                         3.7.1      h33f27b4_3  pkgs/main
python                         3.7.1      h33f27b4_4  pkgs/main
python                         3.7.1      h8c8aaf0_6  pkgs/main
python                         3.7.1      he44a216_5  pkgs/main
python                         3.7.2      h8c8aaf0_0  pkgs/main
python                         3.7.2     h8c8aaf0_10  pkgs/main
python                         3.7.2      h8c8aaf0_2  pkgs/main
python                         3.7.3      h8c8aaf0_0  pkgs/main
python                         3.7.3      h8c8aaf0_1  pkgs/main
python                         3.7.4      h5263a28_0  pkgs/main
python                         3.7.5      h8c8aaf0_0  pkgs/main
python                         3.8.0      hff0d562_0  pkgs/main
python                         3.8.0      hff0d562_1  pkgs/main
python                         3.8.0      hff0d562_2  pkgs/main

Then simple select the version conda install python=3.8.0 if this is the last version.

0

I believe what was requested from you is to create a virtual environment with the latest python version. You can do by executing the command:

conda create -n my_env python=3.7

Here my_env is simply the name of the environment so you can replace it with anything. Also python 3.7 is the latest python version as of the time of this writing but may need to be changed with later version in the future.

Once you've created the environment you can activate it by typing source activate my_env (as the helpful conda message will point out).

2
  • Please delete "conda is python virtual environment manager" as it is not correctly reflecting what conda is and what it is supposed to do. It is a package and environment manager for any language Aug 27, 2018 at 9:05
  • Thank you for this comment. My statement is based on what I am using conda for and you are right this does not reflect the whole functionality it covers. I have edited the wording Aug 27, 2018 at 9:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.