How do I upgrade to Python 3.6 with conda?

匿名 (未验证) 提交于 2019-12-03 08:28:06

问题:

I'm new to Conda package management and I want to get the latest version of Python to use f-strings in my code. Currently my version is (python -V):

Python 3.5.2 :: Anaconda 4.2.0 (x86_64)

How would I upgrade to Python 3.6?

回答1:

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 anaconda
  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 enviroment (Better Method)

conda create --name py36 python=3.6

You can see all this from here

Also refer to this for force upgrading

EDIT: Anaconda now has a Python 3.6 version here



回答2:

Creating a new environment will install python 3.6:

$ conda create --name 3point6 python=3.6 Fetching package metadata ....... Solving package specifications: ..........  Package plan for installation in environment /Users/dstansby/miniconda3/envs/3point6:  The following NEW packages will be INSTALLED:      openssl:    1.0.2j-0          pip:        9.0.1-py36_1      python:     3.6.0-0           readline:   6.2-2             setuptools: 27.2.0-py36_0     sqlite:     3.13.0-0          tk:         8.5.18-0          wheel:      0.29.0-py36_0     xz:         5.2.2-1           zlib:       1.2.8-3 


回答3:

I found it quite difficult to try to upgrade in-place.

What I did was remove my old Anaconda (very simple to uninstall Anaconda):

$ rm -rf ~/anaconda3/

and replace it by downloading the new Anaconda, e.g. Linux, 64 bit:

$ cd ~/Downloads $ wget https://repo.continuum.io/archive/Anaconda3-4.3.0-Linux-x86_64.sh 

and executing it:

$ bash Anaconda3-4.3.0-Linux-x86_64.sh 


回答4:

I found this page with detailed instructions to upgrade Anaconda to a major newer version of Python (from Anaconda 4.0+).

  • conda update conda
  • conda remove argcomplete conda-manager

    I also had to conda remove those packages not on the official list :

    • backports_abc
    • beautiful-soup
    • blaze-core

Depending on packages installed on your system, you can get more UnsatisfiableError... add them to the remove list.

  • conda install python==3.6

    Took a while...Then a message indicates to conda install anaconda-client ...so do I

    • conda install anaconda-client ... and it tells it's already there
  • conda update anaconda

This has been done in Windows 10's Command prompt but things should be similar in Mac OS X.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!