我为卷积神经网络创建了一个tkinter应用程序来识别图像。我试图用pyinstaller编译py文件,但我收到此错误:
AttributeError:类型对象'pandas._libs.tslib._TSObject'没有属性'_reduce_cython_'
当我尝试为测试目的创建一个未完成项目的应用程序时,这个问题恰好发生在我身上。
我导入了pandas,但我没有在我的脚本中调用它。
删除导入行或调用pandas是解决方案。
我用它解决了..
pyinstaller --onefile --hidden-import pandas._libs.tslibs.timedeltas myScript.py and it is working now
你也需要cython,
pip install cython
或conda install cython
pyinstaller --onefile --hidden-import pandas._libs.tslibs.timedeltas program.py
如果你正在使用Jupyter笔记本,请重新启动。它对我有用。还要确保您正在使用正确的python环境。