keras and tensorflow are not running on gpu in centos 7 - linux

I have been trying to run a NN in keras using tf as backend in a centos 7 server but I got this error:
Using Theano backend.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 1135, in _unify_values
sectiondict = self._sections[section]
KeyError: 'blas'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 168, in fetch_val_for_key
return theano_cfg.get(section, option)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 778, in get
d = self._unify_values(section, vars)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/configparser.py", line 1138, in _unify_values
raise NoSectionError(section)
configparser.NoSectionError: No section: 'blas'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 328, in __get__
delete_key=delete_key)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 172, in fetch_val_for_key
raise KeyError(key)
KeyError: 'blas.ldflags'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1250, in check_mkl_openmp
import mkl
ImportError: No module named 'mkl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ffnnecodata2.py", line 1, in <module>
from keras.layers import Input, Dense, LSTM, Activation, Dropout, Reshape
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/backend/__init__.py", line 81, in <module>
from .theano_backend import *
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/keras/backend/theano_backend.py", line 7, in <module>
import theano
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/__init__.py", line 124, in <module>
from theano.scan_module import (scan, map, reduce, foldl, foldr, clone,
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/scan_module/__init__.py", line 41, in <module>
from theano.scan_module import scan_opt
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/scan_module/scan_opt.py", line 60, in <module>
from theano import tensor, scalar
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/__init__.py", line 17, in <module>
from theano.tensor import blas
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/blas.py", line 155, in <module>
from theano.tensor.blas_headers import blas_header_text
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/tensor/blas_headers.py", line 987, in <module>
if not config.blas.ldflags:
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configparser.py", line 332, in __get__
val_str = self.default()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1447, in default_blas_ldflags
check_mkl_openmp()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/theano/configdefaults.py", line 1262, in check_mkl_openmp
""")
RuntimeError:
Could not import 'mkl'. Either install mkl-service with conda or set
MKL_THREADING_LAYER=GNU in your environment for MKL 2018.
If you have MKL 2017 install and are not in a conda environment you
can set the Theano flag blas.check_openmp to False. Be warned that if
you set this flag and don't set the appropriate environment or make
sure you have the right version you *will* get wrong results.
I'm using a conda environment and I tried to install mkl=2017 but it did not work.
I decided to translate my code to tensorflow and tried to run it again, but I got this message now:
Traceback (most recent call last):
File "tensorffnnecodata.py", line 17, in <module>
import tensorflow as tf
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/__init
.py", line 24, in <module>
from tensorflow.python import * # pylint: disable=redefined-builtin
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
_init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/site-packages/tensorflow/python
ywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/imp.py", line 243, in load_modu
return load_dynamic(name, filename, file)
File "/home/powerBuilding/anaconda3/envs/tensorgpu/lib/python3.5/imp.py", line 343, in load_dyna
c
return _load(spec)
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
Do you know what is wrong with my installation?

The error suggests that you need to install cuDNN 7.0 (https://developer.nvidia.com/cudnn) for the version of Cuda you have installed from nVidia website and copy over the files to your Cuda installation folder. Prebuilt binaries of Tensorflow 1.7.0+ requires CUDA 9.0
ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory

Related

Getting error after installation of tensorflow in windows 10?

Traceback (most recent call last):
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\bikash\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed: The specified module could not be found.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

anaconda navigator will no longer start even through cmd, won't install or update or manage environments

I'm new to django and using the anaconda cloud environment. Its been working well for 3 months plus but as of 7-24-2018 it is just stop to launch the navigator or open through cmd. I can't manage environments or install packages. Using the anaconda prompt also gives me the same error upon launching. It started when I wanted to install django-Oscar, but not having its dependencies I was forced to install the packages manually which in turn needed cytoolz that needs Microsoft Visual C++ build tools which I got to install as well but the error persists. Please help me!
Copy/Paste of CMD Traceback:
C:\Users\kaukau\Desktop>conda --version conda 4.5.4
C:\Users\kaukau\Desktop>anaconda-navigator Traceback (most recent call
last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\qtpy__init__.py", line
169, in
from PySide import version as PYSIDE_VERSION # analysis:ignore ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\Scripts\anaconda-navigator-script.py", line
6, in
from anaconda_navigator.app.main import main File "C:\Users\kaukau\Anaconda3\lib\site-packages\anaconda_navigator\app\main.py",
line 22, in
from anaconda_navigator.utils.conda import is_conda_available File
"C:\Users\kaukau\Anaconda3\lib\site-packages\anaconda_navigator\utils__init__.py",
line 15, in
from qtpy.QtGui import QIcon File "C:\Users\kaukau\Anaconda3\lib\site-packages\qtpy__init__.py", line
175, in
raise PythonQtError('No Qt bindings could be found') qtpy.PythonQtError: No Qt bindings could be found
C:\Users\kaukau\Desktop>conda install qt --force Traceback (most
recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 42, in
from cytoolz.dicttoolz import merge File "C:\Users\kaukau\Anaconda3\lib\site-packages\cytoolz__init__.py",
line 1, in
from .itertoolz import * ModuleNotFoundError: No module named 'cytoolz.itertoolz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 819, in call
return func(*args, **kwargs) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\cli\main.py", line
73, in _main
from ..base.context import context File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\base\context.py",
line 23, in
from ..common.configuration import (Configuration, LoadError, MapParameter, PrimitiveParameter, File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 47, in
from .._vendor.toolz.functoolz import excepts File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda_vendor\toolz\functoolz.py",
line 501
f.name for f in reversed((self.first,) + self.funcs),
^ SyntaxError: Generator expression must be parenthesized
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 42, in
from cytoolz.dicttoolz import merge File "C:\Users\kaukau\Anaconda3\lib\site-packages\cytoolz__init__.py",
line 1, in
from .itertoolz import * ModuleNotFoundError: No module named 'cytoolz.itertoolz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\Scripts\conda-script.py", line 10, in
sys.exit(main()) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\cli\main.py", line
113, in main
return conda_exception_handler(_main, *args) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 1112, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 822, in call
return self.handle_exception(exc_val, exc_tb) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 864, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 876, in handle_unexpected_exception
self.print_unexpected_error_report(error_report) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 932, in print_unexpected_error_report
from .base.context import context File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\base\context.py",
line 23, in
from ..common.configuration import (Configuration, LoadError, MapParameter, PrimitiveParameter, File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 47, in
from .._vendor.toolz.functoolz import excepts File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda_vendor\toolz\functoolz.py",
line 501
f.name for f in reversed((self.first,) + self.funcs),
^ SyntaxError: Generator expression must be parenthesized Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 42, in
from cytoolz.dicttoolz import merge File "C:\Users\kaukau\Anaconda3\lib\site-packages\cytoolz__init__.py",
line 1, in
from .itertoolz import * ModuleNotFoundError: No module named 'cytoolz.itertoolz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\cli\main.py", line
97, in main
from ..activate import main as activator_main File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\activate.py", line
11, in
from .base.context import ROOT_ENV_NAME, context, locate_prefix_by_name File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\base\context.py",
line 23, in
from ..common.configuration import (Configuration, LoadError, MapParameter, PrimitiveParameter, File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 47, in
from .._vendor.toolz.functoolz import excepts File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda_vendor\toolz\functoolz.py",
line 501
f.name for f in reversed((self.first,) + self.funcs),
^ SyntaxError: Generator expression must be parenthesized
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 42, in
from cytoolz.dicttoolz import merge File "C:\Users\kaukau\Anaconda3\lib\site-packages\cytoolz__init__.py",
line 1, in
from .itertoolz import * ModuleNotFoundError: No module named 'cytoolz.itertoolz'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\kaukau\Anaconda3\Scripts\conda-script.py", line 10, in
sys.exit(main()) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\cli\main.py", line
110, in main
return ExceptionHandler().handle_exception(exc_val, exc_tb) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 864, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 876, in handle_unexpected_exception
self.print_unexpected_error_report(error_report) File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\exceptions.py",
line 932, in print_unexpected_error_report
from .base.context import context File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda\base\context.py",
line 23, in
from ..common.configuration import (Configuration, LoadError, MapParameter, PrimitiveParameter, File
"C:\Users\kaukau\Anaconda3\lib\site-packages\conda\common\configuration.py",
line 47, in
from .._vendor.toolz.functoolz import excepts File "C:\Users\kaukau\Anaconda3\lib\site-packages\conda_vendor\toolz\functoolz.py",
line 501
f.name for f in reversed((self.first,) + self.funcs),
^ SyntaxError: Generator expression must be parenthesized
I've just found out that I cant even use any conda commands except the : >conda --version< command only.
Please help me resolve this issue without uninstalling then reinstalling anaconda completely
Sorry to waste your time, I solved it by reinstalling anaconda completely and every project started working again....thanks to those who read it, the effort is appreciated.
It usually happen when you directly download and insall anaconda normally form its website.
Updating anaconda solved this issue for me in Manjaro and will surely work on Windows as well.
use conda update anaconda-navigator command to Update Anaconda.
If it doesn't starts, restart your pc and try to open it again.

having trouble install tensorflow

So I am learning deep learning. For convolutional neural networks purpose I need tensorflow. I installed tensorflow and several packages with the following command:
conda create -n tensorflow python=3.5
source activate tensorflow
conda install pandas matplotlib jupyter notebook scipy scikit-learn
pip install tensorflow
but then when I tried to run this it failed:
# Python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
anyone knows what went wrong thanks?
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: #rpath/libcudart.8.0.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/yiransi/Documents/tensorflowtest.py", line 3, in <module>
import tensorflow as tf
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: #rpath/libcudart.8.0.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
>>>

Setting the path to CUDA in THEANO_FLAGS

I try to set the THEANO_FLAGS and then import Theano. This always results in an error.
In [1]: import os
In [2]: os.environ["THEANO_FLAGS"] = "cuda.root=/usr/local/cuda,device=cuda,floatX=float32"
In [3]: import theano
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/Users/anonymouse/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 164, in <module>
use(config.device)
File "/Users/anonymouse/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 151, in use
init_dev(device)
File "/Users/anonymouse/anaconda2/lib/python2.7/site-packages/theano/gpuarray/__init__.py", line 60, in init_dev
sched=config.gpuarray.sched)
File "pygpu/gpuarray.pyx", line 634, in pygpu.gpuarray.init
File "pygpu/gpuarray.pyx", line 584, in pygpu.gpuarray.pygpu_init
File "pygpu/gpuarray.pyx", line 1057, in pygpu.gpuarray.GpuContext.__cinit__
GpuArrayException: Could not load "/Developer/NVIDIA/CUDA-7.0/lib/libnvrtc.dylib": dlopen(/Developer/NVIDIA/CUDA-7.0/lib/libnvrtc.dylib, 5): image not found
How could I change the path "/Developer/NVIDIA/CUDA-7.0/lib/libnvrtc.dylib" to "/usr/local/cuda/lib/libcuda.dylib"?

Tensorflow import error: module 'imp' has no attribute 'find_module'

I am trying to import tensorflow (I have installed on 14.04 LTS and tensorflow 0.8) but it shows
atributeError: module 'imp' has no attribute 'find_module'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/\__init__.py", line 23, in <module>
from tensorflow.python import *
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/\__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/home/prayalankar/anaconda3/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(\__file__)])
AttributeError: module 'imp' has no attribute 'find_module'
How to proceed?
Seems that I had a imp.py in home directory which was confusing the imp of python so I had to change the name of imp.py

Resources