成功解决AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'

成功解决AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'


解决问题

  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 "h5py\h5r.pxd", line 21, in init h5py._conv
  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 "h5py\h5r.pyx", line 145, in init h5py.h5r
AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'
[25780] Failed to execute script CV_Object

解决思路

没有该属性,一般都是版本不兼容引起的!

相关文章
no attribute __reduce_cython__ #1953
Cython的用法以及填坑姿势

解决方法

T1、更新Cython 库、scipy库

很可能是Cython 0.26与python3不兼容,更新Cython 库、scipy库

最后,再配置解决的方法,给定参数即可

--hidden-import=h5py

T2、降低h5py库的版本

哈哈!大功告成!

(0)

相关推荐