简体   繁体   中英

Convert Anaconda and Spyder from Python 2 to 3

I currently have Python 2.7 and need to fully convert my Anaconda and the Spyder IDE to Python 3.6. I have a testing environment currently in Python 3.6, but my root was installed and downloaded as 2.7. I do not need to preserve Python 2.7 capabilities. Before I mess up my Anaconda... do these steps make sense to convert my root to Python 3.6?

source activate root conda update conda conda update --all python=3.6

Would I need conda update anaconda and conda update spyder as well?

You've got a few options.

  1. Update the current environment by installing python 3.6 into it. eg:

$ conda install python=3.6

Note that this will not work if you have any packages installed that are not python 3.6 compatible. If you do have conda packages that are not py3.6 compatible, you'll get errors like:

$ conda update --all python=3.6
Fetching package metadata .............
Solving package specifications: ....


UnsatisfiableError: The following specifications were found to be in conflict:
  - enum34
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

And you'll need to go through and remove all of the offending packages.

  1. Another option is to create a new conda environment with python 3.6 and spyder (and any other dependencies that you need).

    $ conda create -n py36 python=3.6 spyder ..

    $ source activate py36

    $ spyder

  2. Final option is to remove your conda folder and then reinstall anaconda with python 3.6 or miniconda with python 3.6.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM