Conda Env:Python没有从Env包中加载Tensorflow模块

时间:2018-02-08 08:43:40

标签: python tensorflow

在安装和卸载tensorflow之后,尝试在这个特定的Conda环境中识别GPU,我发现没有从env包中调用tensorflow模块。

Python 3.5.4 |Anaconda, Inc.| (default, Oct 13 2017, 11:22:58) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> import tensorflow
/home/fosa/.local/lib/python3.5/site-packages/h5py/__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
>>> print(matplotlib.__file__)
/home/fosa/anaconda3/envs/newTensor/lib/python3.5/site-packages/matplotlib/__init__.py
>>> print(tensorflow.__file__)
/home/fosa/.local/lib/python3.5/site-packages/tensorflow/__init__.py
>>> 

知道怎么解决这个问题吗?我的其他使用python = 2.7的Env没有问题。

1 个答案:

答案 0 :(得分:0)

当我在python中检查sys.path时,它在ENV目录之前列出了全局包目录。将本地anaconda env放在全局包目录之前解决了问题。