15
votes

I have updated numpy to 1.14.0. I use Windows 10. I tried to run my code and I got this error:

AttributeError: module 'numpy' has no attribute 'square'

Here are my imports:

%matplotlib inline
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
from sklearn.metrics import confusion_matrix
import math
1
If you called a file numpy.py, pick a different name (and delete the corresponding numpy.pyc if there is one). - user2357112 supports Monica
show the entire code and the entire error - ShpielMeister
@user2357112 I did as u said but my new error is :module 'numpy' has no attribute '__version__' - Hoda Fakharzadeh
I got this error when loading matplotlib - mikey

1 Answers

16
votes

I removed numpy.py then updated my numpy and it worked!