3

I used this

conda  create --name intelpy --channel intel --override-channels intelpython

to create an environment and install intelpython

and conda info --envs shows

# conda environments:
#
intelpy               *  /home/admin-pc/anaconda3/envs/intelpy
py27                     /home/admin-pc/anaconda3/envs/py27
root                     /home/admin-pc/anaconda3

However, when I source activate intelpy

admin-pc@Precision-Tower:~$ source activate intelpy
(intelpy) admin-pc@Precision-Tower:~$ which python
/home/admin-pc/anaconda3/bin/python

it still uses the anaconda python, what is wrong?


Thanks to orangeInk. Adding python=3.6 works

conda  create --name intelpy --channel intel --override-channels intelpython python=3.6
user15964
  • 2,507
  • 2
  • 31
  • 57

1 Answers1

6

You should add the python argument to your create command. Omitting it will make the new environment use the system default Python interpreter rather than installing a new one.

conda create --name intelpy python=3.6

(use 2.7 instead of 3.6 for a Python 2 environment)

orangeInk
  • 1,360
  • 8
  • 16
  • 1
    One small clarification, if you do not include the Python argument, it will not install Python at all (hence, as the OP shows, `which python` points to the Python in the base environment). Omitting the argument does not make the environment use the system default Python, it means that there is no Python in that environment and you will not be able to import packages installed in that environment in the base environment's Python – darthbith Jan 17 '18 at 16:20
  • @darthbith Not 100% sure what you mean. When you create an environement without the `python` argument and activate it you can fully use the root environment's interpreter in that environement (not that that's useful). Either I'm missing your point or the confusion arose from me simply assuming that conda root env == system default interpreter. – orangeInk Jan 18 '18 at 07:56
  • 2
    I guess I had two points, both of which you mentioned in the comment here: 1) conda root env != system default interpreter, and 2) it's not very useful to use the root environment's Python in a separate environment (I guess unless you have R or something else in that environment, I shouldn't be so "python-normative") :-) – darthbith Jan 18 '18 at 12:33