2
votes

I just started to learn how to use Anaconda to manage packages. I am trying to install tensorflow in conda environment. So first of all, I create an environment by:

conda create -n tensorflow

Then, I source it by:

source activate tensorflow

I can see my prompt changed so I think it is going right.

I notice that it seems that the tensorflow environment is copying from ~/anaconda2/lib/ where I do have my root version python2.7 and tensorflow0.12.0

I installed a new version Python in tensorflow environment by:

conda install python=3.5

Then, I follow the steps to install tensorflow by:

pip install --ignore-installed --upgrade TF_PYTHON_URL

However, when I do conda list, I can only see Python3.5 but not tensorflow1.0. I also failed to import tensorflow when I am in Python.

So I have two questions that really confuse me.

  1. Why does the pip installed tensorflow not show up when I do conda list?
  2. Although I conda install python=3.5 and I can see it from conda list, I am not using python 3.5 when I enter Python directly. It seems still using Python2.7, which comes from my root environment.

I appreciate any tutorial on how anaconda works.

2
what OS are you using? Do you see tensorflow with pip list ?anon01
The anaconda documentation is pretty clear about all this.Mad Physicist
@MadPhysicist If you have something helpful to say, why don't you just say it?anon01
I pointed op to the root of all anaconda tutorials. Why are you getting offended on someone else's behalf?Mad Physicist
@MadPhysicist RTFM is helpful if you add a link/section. Otherwise don't even waste the keystrokes.anon01

2 Answers

1
votes

I think your pip install is installing into the global environment instead of tensorflow. Why don't you try installing by specifying the path? For example pip install --target $HOME/anaconda3/tensorflow tensorflow(Where the first tensorflow is your environment and the second is the actual package).


I just saw the last two questions. So you actually see the tensorflow you installed with pip? I am confused now. Type which pip to see if it is running from the tensorflow environment or the global. You could also try source deactivate before source activate tensorflow just to make sure that you are not using a different environment, then run which python. It should show your new environment.

-1
votes

If you want to create an environment using a specific version of Python (rather than the system default), you can do for example:

conda create --name myCoolEnv python=3.5

and then activate with

source activate myCoolEnv

You can read more about Anaconda environments here.