成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython

简介: 成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython

解决问题


File "stringsource", line 104, in init scipy.interpolate.interpnd


AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__'


Traceback (most recent call last):

 File "CV_Object2.py", line 22, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "yolo.py", line 13, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras\__init__.py", line 7, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras\datasets\__init__.py", line 4, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras\datasets\imdb.py", line 8, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras\preprocessing\__init__.py", line 12, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras\preprocessing\image.py", line 7, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "keras_preprocessing\image.py", line 10, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\ndimage\__init__.py", line 161, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\ndimage\filters.py", line 38, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\ndimage\_ni_docstrings.py", line 4, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\misc\__init__.py", line 68, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\interpolate\__init__.py", line 175, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 665, in _load_unlocked

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module

   exec(bytecode, module.__dict__)

 File "scipy\interpolate\interpolate.py", line 32, in <module>

 File "<frozen importlib._bootstrap>", line 971, in _find_and_load

 File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked

 File "<frozen importlib._bootstrap>", line 656, in _load_unlocked

 File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible

 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

 File "stringsource", line 104, in init scipy.interpolate.interpnd

AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython__'

[11956] Failed to execute script CV_Object2


解决思路


文件“stringsource”,第104行,在init scipy.interpolate.interpnd中

属性错误:类型对象“scipy.interpolate.interpnd.array”没有属性“uuReduce_Cython_uuuuuuu”







解决方法

image.png


调整scipy、cython库



yeah ! version scipy-0.19.1-py3.6.egg-info


 File "f:\program files\python\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module

   module = loader.load_module(fullname)

 File "stringsource", line 103, in init scipy.optimize._trlib._trlib

AttributeError: type object 'scipy.optimize._trlib._trlib.array' has no attribute '__reduce_cython__'

[3540] Failed to execute script CV_Object2

C:\Users\99386>pip show cython

Name: Cython

Version: 0.28.3

Summary: The Cython compiler for writing C extensions for the Python language.

Home-page: http://cython.org/

Author: Robert Bradshaw, Stefan Behnel, Dag Seljebotn, Greg Ewing, et al.

Author-email: cython-devel@python.org

License: Apache

Location: f:\program files\python\python36\lib\site-packages

Requires:

Required-by:

C:\Users\99386>pip show scipy

Name: scipy

Version: 1.0.0

Summary: SciPy: Scientific Library for Python

Home-page: https://www.scipy.org

Author: SciPy Developers

Author-email: scipy-dev@python.org

License: BSD

Location: f:\program files\python\python36\lib\site-packages

Requires: numpy

Required-by: Keras, Keras-Preprocessing, imgaug, face-recognition

C:\Users\99386>pip install --upgrade scipy

Collecting scipy

 Using cached https://files.pythonhosted.org/packages/62/e2/364f0bcc641aeff79d743c732769d5dc31a1e78c27699229431412c4b425/scipy-1.1.0-cp36-none-win_amd64.whl

Requirement not upgraded as not directly required: numpy>=1.8.2 in f:\program files\python\python36\lib\site-packages (from scipy) (1.15.0rc1+mkl)

tensorflow-gpu 1.4.0 requires enum34>=1.1.6, which is not installed.

wxpy 0.3.9.8 has requirement itchat==1.2.32, but you'll have itchat 1.3.10 which is incompatible.

moviepy 0.2.3.2 has requirement decorator==4.0.11, but you'll have decorator 4.3.0 which is incompatible.

Installing collected packages: scipy

 Found existing installation: scipy 1.0.0

   Uninstalling scipy-1.0.0:

     Successfully uninstalled scipy-1.0.0

Successfully installed scipy-1.1.0



相关文章
|
27天前
|
Python
通过 type 和 object 之间的关联,进一步分析类型对象
通过 type 和 object 之间的关联,进一步分析类型对象
51 3
|
3月前
|
Docker 容器
成功解决:Caused by: ParsingException[Failed to parse object: expecting token of type [START_OBJECT] but
这篇文章讨论了在使用Docker启动Elasticsearch容器时遇到的一个具体问题:由于配置文件`elasticsearch.yml`解析出错导致容器启动失败。文章提供了详细的排查过程,包括查看容器的日志信息、检查并修正配置文件中的错误(特别是空格问题),并最终成功重新启动了容器。
|
3月前
|
TensorFlow 算法框架/工具 Python
【Tensorflow 2】解决'Tensor' object has no attribute 'numpy'
解决'Tensor' object has no attribute 'numpy'
51 3
|
3月前
|
JSON 数据格式 Python
【python】解决json.dump(字典)时报错Object of type ‘float32‘ is not JSON serializable
在使用json.dump时遇到的“Object of type ‘float32’ is not JSON serializable”错误的方法,通过自定义一个JSON编码器类来处理NumPy类型的数据。
111 1
|
3月前
|
API C++ Python
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
|
4月前
|
并行计算 Serverless API
函数计算操作报错合集之出现 "AttributeError: 'NoneType' object has no attribute 'pop'" 错误,是什么原因
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
119 1
|
3月前
|
TensorFlow API 算法框架/工具
【Tensorflow+keras】解决使用model.load_weights时报错 ‘str‘ object has no attribute ‘decode‘
python 3.6,Tensorflow 2.0,在使用Tensorflow 的keras API,加载权重模型时,报错’str’ object has no attribute ‘decode’
48 0
|
30天前
|
Java
Java Object 类详解
在 Java 中,`Object` 类是所有类的根类,每个 Java 类都直接或间接继承自 `Object`。作为所有类的超类,`Object` 定义了若干基本方法,如 `equals`、`hashCode`、`toString` 等,这些方法在所有对象中均可使用。通过重写这些方法,可以实现基于内容的比较、生成有意义的字符串表示以及确保哈希码的一致性。此外,`Object` 还提供了 `clone`、`getClass`、`notify`、`notifyAll` 和 `wait` 等方法,支持对象克隆、反射机制及线程同步。理解和重写这些方法有助于提升 Java 代码的可读性和可维护性。
|
3月前
|
Java
【Java基础面试二十】、介绍一下Object类中的方法
这篇文章介绍了Java中Object类的常用方法,包括`getClass()`、`equals()`、`hashCode()`、`toString()`、`wait()`、`notify()`、`notifyAll()`和`clone()`,并提到了不推荐使用的`finalize()`方法。
【Java基础面试二十】、介绍一下Object类中的方法
|
2月前
|
Python
类与面向对象编程(Object-Oriented Programming, OOP)
类与面向对象编程(Object-Oriented Programming, OOP)
16 0