Moving from Anaconda 2 to Anaconda 3 and Virtual Environments

4.6k views Asked by At

I have Anaconda 2 installed on Mac OS Sierra (10.12.2). I would like to:

a) Move from Anaconda 2 to Anaconda 3. I know it can be done through virtual environments created via conda, but I'm not interested in that as I'd like for Anaconda/Python 3.5 to be my default version of python (that way, I won't have to type source activate Python3 every time I want to run that version of Python).

b) Preserve the current virtual environments I have created with conda (I have three virtual envs running Python 2 and Python 3).

I have read the Continuum documentation and similar questions posted here, but none actually address my two requirements.

Thanks in advance for your help.

1

There are 1 answers

1
Marjan Moderc On

I don't think you have to install anaconda3 just for the sake of having python3 based root environment. Just set a desired environment (in your example Python3) as the default environment, as it is shown in this example.

EDIT:

  • Solution 1

The same procedure applies if you only want to update/upgrade the default conda environment. If you run conda env list, you will notice the last env called root. This is your default python environment after you install anaconda, so you can manage it just like all the others: by typing source activate root. Once you are done with the updating, all the changes will apply to your default python.

Keep in mind that you will have to deal with some conflicting package dependencies if you have a installed packages that don't have support for the specific python3.* that you are after. You will have to fix those manually.

  • Solution 2

If you really want to move to Anaconda3, you can still save the environment files of all the environments you wish to preserve and recreate them within freshly installed Anaconda3 with the conda env create -f env_export_file.yml