Will creating a new Anaconda environment prevent package version override?

时间:2019-04-08 13:03:54

标签: python tensorflow anaconda conda

I am unclear whether I should create a new environment or/and a new channel in the following case:

I have an anaconda with a ~base environment. I created an environment A, a few months ago and installed the Tensorflow version of it at the time. I want to import a new piece of code I found which uses Keras. I want to avoid breaking my environment A. Will creating an environment B and installing Keras and TensorFlow in it be enough ? Or am I at risk of overwriting my TensorFlow package from environment A.

I guess what I am unclear about is whether, environment contain channels, or if the channels are shared between the environment and Conda loads the packages from the shared channels based on what is requested by the environment.

1 个答案:

答案 0 :(得分:1)

Conda environment works like virtualenv module for Python. So, yes - you can install different versions of lib into different environments. For example it may be useful, if you want to keep Tensorflow-CPU and Tensorflow-GPU versions installed at the same time. The same thing with Keras. You may read about it e.g. here: Tensorflow-GPU installation