1. 程式人生 > >成功解決pyinstaller打包AttributeError:type object pandas._TSObject has no attribute _reduce_cython_

成功解決pyinstaller打包AttributeError:type object pandas._TSObject has no attribute _reduce_cython_

解決問題

pyinstaller打包出現AttributeError:type object pandas._libs.tslibs.conversion._TSObject has no attribute _reduce_cython_


解決方法

1、先嚐試隱藏模組的方法
pyinstaller -F CV_Object.py --icon=Jasonniu.ico --hidden-import=pandas._libs.tslibs.conversion._TSObject.__reduce_cython__
(1)、pyinstaller -F CV_Object.py --icon=Jasonniu.ico --hidden-import=pandas._libs.tslibs.conversion._TSObject
(2)、pyinstaller -F CV_Object.py --icon=Jasonniu.ico --hidden-import=yolo3 --hidden-import=yolo3
-F 指只生成一個exe檔案,不生成其他dll檔案
-w 不彈出命令列視窗
-i 設定程式圖示 ,其後面的ico檔案就是程式圖示
yyy.py 就是要打包的程式
–hidden-import=pandas._libs.tslibs.conversion._TSObject.__reduce_cython_ 隱藏相關模組的引用
或者修改*.spec檔案的內容,修改引數即可hiddenimports=['name01','name02']
或者手動新增包所在路徑:
pyinstaller -F -p 
最後解決的方法:pyinstaller CV_Object.py --icon=Jasonniu.ico --hidden-import=h5py
2、更新pandas庫的方法


3、如果你看到這裡,還沒解決你的問題,那麼答案只有一個,你用的python是3.0以上的,就會出現這個問題,python2.7、2.8就不會出現這個問題。




相關文章
scipy.optimize._trlib._trlib.array' has no attribute '__reduce_cython__' when using pyinstaller
no attribute __reduce_cython__ #1953