成功解决AttributeError: module 'numpy' has no attribute 'equal'

简介: 成功解决AttributeError: module 'numpy' has no attribute 'equal'

解决问题


ttributeError: module 'numpy' has no attribute 'equal'

Traceback (most recent call last):

 File "F:\File_Python\Python_daydayup\190323.py", line 3, in <module>

   import tensorflow

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in <module>

   from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 63, in <module>

   from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\framework_lib.py", line 25, in <module>

   from tensorflow.python.framework.ops import Graph

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 40, in <module>

   from tensorflow.python.eager import context

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\eager\context.py", line 29, in <module>

   from tensorflow.python.framework import c_api_util

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\c_api_util.py", line 25, in <module>

   from tensorflow.python.util import compat

 File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\util\compat.py", line 129, in <module>


image.png




解决思路


根据bug,可知,tensorflow版本有问题,换个tensorflow的版本


查看版本的方法


import tensorflow as tf

print(tf.__version__)






解决方法


1、更新tensorflow:博主电脑上有多个版本的tensorflow库,将Anaconda的tensorflow版本更新到python库内即可!

image.png


2、更新numpy库


参考文章:成功解决from scipy.linalg import _fblas ImportError: DLL load failed: 找不到指定的模块。



3、最后的结果显示

image.png


image.png




哈哈,成功运行!




 


相关文章
|
7月前
|
数据处理 Python
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法
402 0
成功解决AttributeError: module 'numpy' has no attribute 'integer'
成功解决AttributeError: module 'numpy' has no attribute 'integer'
成功解决AttributeError: module 'numpy' has no attribute 'integer'
|
2月前
|
Shell 计算机视觉 Python
no module named cv2 、numpy 、xxx超全解决方案
no module named cv2 、numpy 、xxx超全解决方案
35 0
|
11月前
|
TensorFlow 算法框架/工具 计算机视觉
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
No module named ‘cv2‘ 解决办法 (No module named ‘numpy‘ 等所有报错均可解决)
367 0
|
API Python
解决办法:RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
解决办法:RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
130 0
|
Python
python3中报错No module named 'numpy'
python3中报错No module named 'numpy'
70 0
|
Python
【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘numpy‘ )
【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘numpy‘ )
824 0
【错误记录】Mac 中 IntelliJ IDEA 运行 Python 程序报错 ( No module named ‘numpy‘ )
|
Python
python no module named numpy.distutils.core
有小伙伴在按照 微软开源分布式高性能GB框架LightGBM安装使用——Python  操作时,遇到错误: no module named numpy.distutils.core 完整错误信息: File "C:\soft\Python27\lib\site-packages\setuptools\command\easy_install.
4427 0
|
1月前
|
机器学习/深度学习 存储 算法
Python中的NumPy库:数值计算与科学计算的基石
【2月更文挑战第29天】NumPy是Python科学计算的核心库,专注于高效处理大型多维数组和矩阵。其核心是ndarray对象,提供快速数组操作和数学运算,支持线性代数、随机数生成等功能。NumPy广泛应用于数据处理、科学计算和机器学习,简化了矩阵运算、统计分析和算法实现,是数据科学和AI领域的重要工具。
|
1月前
|
存储 索引 Python
请解释Python中的NumPy库以及它的主要用途。
【2月更文挑战第27天】【2月更文挑战第97篇】请解释Python中的NumPy库以及它的主要用途。