Different available packages in TensorFlow virtualenv? I have installed TensorFlow on Linux (Anaconda) by following the documentation which states that one should create and activate a virtual environment tensorflow. So far, so good (albeit it is not entirely clear why is this virtual environment is necessary when I want to incorporate TF to my existing env).

But when I activate the tensorflow environment I observe that several packages are unavailable in the new environment while available outside the environment at the same time:

$source activate tensorflow
$python

&gt;&gt;&gt;import h5py

... No module named h5py

$source deactivate tensorflow
$python

&gt;&gt;&gt;import h5py
&gt;&gt;&gt;


No problem in this case.

I guessed that I should install the missing package in the tensorflow environment as well, but when I try to, I get informed that the package in question has already been installed and nothing happens:

$source activate tensorflow
$pip install h5py

Requirement already statisfied ....


The same inconsistency occurs with several other packages. What is the problem here?
I can't offer any suggestions as to why your virtual environment can't find the packages (I'm not familiar with anaconda). The only thing that comes to mind is a PATH problem.

Perhaps try installing the package with the following command:

conda install -n yourenvname [package]


or, in your case:

conda install -n tensorflow h5py



  To install additional packages only to your virtual environment, enter
  the following command where yourenvname is the name of your
  environemnt, and [package] is the name of the package you wish to
  install. Failure to specify “-n yourenvname” will install the package
  to the root Python installation.


source: https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/