The latest anaconda distribution released on Sep2018 uses python v3.7. My existing anaconda distribution uses python v3.6
I would like to upgrade to this latest distribution which uses python v3.7. When I tried to install from the Windows installation executable file, there is no smooth upgrade. If I were to do a clean reinstall, I will have re-install all the conda and pip packages outside of the standard anaconda distribution that I am currently using.
How can I do an anaconda upgrade while preserving all these conda and pip packages that I am currently using that are out of the standard anaconda distribution?
I tried the following command;
conda list --explicit > environment_backup.txt
environment_backup.txt
does not seem to contain the pip packages that I have installed.
I am fine if all the conda and pip packages cannot be preserved during the upgrade. However, I would like to have a convenient way to reinstall these conda and pip packages after the new version has been installed. It will be inconvenient if I have to run conda install XXX
or pip install XXX
commands individually.
Built into Anaconda, conda is a powerful package manager and environment manager that you use with command-line in the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda.
Conda creates language-agnostic environments natively whereas pip relies on virtualenv to manage only Python environments Though it is recommended to always use conda packages, conda also includes pip, so you don't have to choose between the two.
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With