arnavlohe15
arnavlohe15

Reputation: 334

Tensorflow Import Error (compat.py_: AttributeError: 'module' object has no attribute 'integer'

I am trying to use tensorflow for a research project, but I am unable to import it into my program even though I successfully installed it using Anaconda. I am using a Mac 10.13.5. Whenever I try to import tensorflow, I keep receiving this error: AttributeError: 'module' object has no attribute 'integer' in the tensorflow file compat.py. The error is at line 129 of this file:

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/util/compat.py

at the line: "integral_types = (_numbers.Integral, _np.integer)"

Can anyone help me resolve this so that I can use tensorflow? Thank you.

Upvotes: 3

Views: 2045

Answers (1)

Le-Vu Tran
Le-Vu Tran

Reputation: 62

I did encountered that problem also. I tried re-installing numpy with pip install -U --force-reinstall numpy and things worked. Hope it works for you too.

Upvotes: 3

Related Questions