成功解决AttributeError: type object 'scipy.interpolate.interpnd.array' has no attribute '__reduce_cython-阿里云开发者社区

开发者社区> 开发与运维> 正文
登录阅读全文

成功解决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



版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章
最新文章
相关文章