I have a python 2.7 conda environment and would like to create an equivalent environment with python 3.4. I am aware of the --clone
option when creating enviro
One way would be to
conda list --export > exported-packages.txt
And then edit that file to remove the last part of each package with the py27_0
parts (you might also want to remove the versions, in case some version of a package doesn't have a Python 3 version). Then
conda create -n py3clone --file exported-packages.txt
Another idea would be to clone the environment:
conda create -n clonedenv --clone oldenv
conda install -n clonedenv python=3.4
conda update -n clonedenv --all
Note that obviously both of these will fail if you have some package that doesn't have a Python 3 version.
I tried this and had a lot of issues with plot.ly being updated to v. 4. My code was written on 3.10 and didn't feel like changing it. I had to copy the whole environment (every single file from \envs) from one machine to next, it works.