How to Upgrade to Python 3.6 with Conda

How do I upgrade to Python 3.6 with conda?

Anaconda has not updated python internally to 3.6.

a) Method 1

  1. If you wanted to update you will type conda update python

  2. To update anaconda type conda update conda

  3. If you want to upgrade between major python version like 3.5 to 3.6, you'll have to do

    conda install python=$pythonversion$

b) Method 2 - Create a new environment (Better Method)

conda create --name py36 python=3.6

c) To get the absolute latest python (3.6.5 at time of writing)

conda create --name py365 python=3.6.5 --channel conda-forge

You can see all this from here

Also, refer to this for force upgrading

EDIT: Anaconda now has a Python 3.6 version here

How to install python with conda?

To create python 3.10 conda environment use the following command

conda create -n py310 python=3.10
py310 - environment name

Update 2

You can now directly create python 3.9 environment using the following command

conda create -n py39 python=3.9
py39 - environment name

Update 1

Python 3.9 is now available in conda-forge.

To download the tar file - https://anaconda.org/conda-forge/python/3.9.0/download/linux-64/python-3.9.0-h852b56e_0_cpython.tar.bz2

Anaconda Page - https://anaconda.org/conda-forge/python


As pointed out in the comments, python 3.9 is not yet there on any channels. So, it cannot be install yet via conda.

Instead, you can download the python 3.9 executable and install it.

Once the installation is done, a new executable will be created for python 3.9 and pip 3.9 will be created.

Python:

python3.7          
python3.7-config
python3.7m
python3.7m-config
python3.9
python3.9-config

pip

pip      
pip3
pip3.7
pip3.8
pip3.9
pipreqs

In order to install ipython for python 3.9,

pip3.9 install ipython

How to change Python version of existing conda virtual environment?

Activate the relevant environment, then install your target python version.

conda activate my_env
conda install python=3.6

How to update Python to the latest version in Conda environment?

First check for all the python version available to install using conda search python. It will give list like below.

# Name                       Version           Build  Channel             
python 2.7.13 hac47a24_15 pkgs/main
.
.
.
python 3.8.2 h191fe78_0 pkgs/main
python 3.8.2 hcf32534_0 pkgs/main
python 3.8.2 hcff3b4d_13 pkgs/main
python 3.8.2 hcff3b4d_14 pkgs/main
python 3.8.3 hcff3b4d_0 pkgs/main
python 3.8.3 hcff3b4d_2 pkgs/main

Then, install the latest version using conda install python=3.8.3.

How to update Python version of my conda environment without loosing packages

Within the environment:

conda install python=3.10

... and as always read the docs

How can I download Anaconda for python 3.6

As suggested here, with an installation of the last anaconda you can create an environment just like Cleb explained or downgrade python :

conda install python=3.6.0

With this second solution, you may encounter some incompatibility issues with other packages. I tested it myself and did not encounter any issue but I guess it depends on the packages you installed.

If you don't want to handle environments or face incompatibilities issues, you can download any Anaconda version here: https://repo.continuum.io/archive/. For example, Anaconda3-5.1.0-XXX or Anaconda3-5.2.0-XXX provides python 3.6 (the suffix XXX depends on your OS).

To know which python is provided in an anaconda package, you can visit the Release notes page. It provides the updates for the all anaconda versions. Find yours and look for the line

python A.B.C -> X.Y.Z

where A.B.C is the previous version and X.Y.Z is the updated python version.

Installing python 3.6 , when I am already using Anaconda Python 2.7

are you able to create a new environment with the command:

conda create -n py36 python=3.6

?
if so, anaconda will create a new subfolder for this environment in the anaconda/envs folder named py36. in spyder you can go to tools->preferences->python interpreter and choose the python interpreter (python.exe if on windows) in that folder. to use pip and all in the commandline for that environment write:

if on linux/mac:

source activate py36

if on windows:

activate py36

then continue to do you installations and all.

Update python from 3.5 to 3.6 in conda

I find that reinstalling a new environment is a better choice.



Related Topics



Leave a reply



Submit