Skip to content
Advertisement

python conda: created a environment, but it is not using conda’s python

I have been using anaconda for a while, and its Python executable is located at /Users/ufo/opt/anaconda3/bin/python. I have tried to create an environment with conda, and the new environment would use copy this Python to environment’s bin.

However, with current Anaconda versation, the new environment will not use anaconda’s Python, but use the original Python pre-installed with Mac OS, which was python 2.*.

Here is a snip of checking anaconda python version, creating/activating new environment, and checking again. From the snip I noticed the change of $PATH as well as Python versions.

How can I still use anaconda’s Python in new environment?

JavaScript

Advertisement

Answer

An easy workaround would be to export the path to the python you require once you activate the environment. As can be seen in the below snipet.

JavaScript

you can then use which python to see if your python is rightly set

To use your environments python do

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement