4

I have a python3.5 (Ana)conda environment myenv. I installed many packages (and also my own custom packages) in that environment. Can I update myenv to python3.6 without having to create a new environment and re-installing all the packages (manually)? What would be the easiest way to migrate to python3.6?

PDiracDelta
  • 2,348
  • 5
  • 21
  • 43
  • 1
    Is this Anaconda environment your **base** env? If so, that is much more difficult and risky to do in-place. The safest transition is to export the env (`conda env export --no-builds`) and update the YAML to include Python 3.6. The local packages you'd have to handle manually. Possible duplicate: https://stackoverflow.com/questions/41535881/how-do-i-upgrade-to-python-3-6-with-conda – merv Sep 24 '19 at 16:02
  • The `--from-history` flag might also be useful in this context since it will generate a minimal env YAML that only includes explicitly requested files. However, I'm not sure if it captures `pip` installed packages. – merv Sep 24 '19 at 16:45
  • @merv it's not my base env. Will try it ASAP (without the `--from-history` flag) – PDiracDelta Sep 24 '19 at 16:52
  • @merv strange, it seems that I already was at python3.6, however my IDE listed the environment as 3.5. I had probably upgraded it before. I didn't test your method, but since python is listed as a 'package' inside the YAML, I suspect your method will work, but what would probably *also* work (and be easier) is just updating the python 'package' inside the conda env. – PDiracDelta Sep 25 '19 at 08:35

0 Answers0