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


image.png




解决方法


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库的方法

image.png

3、如果你看到这里,还没解决你的问题,那么答案只有一个,你用的python是3.0以上的,就会出现这个问题,python2.7、2.8就不会出现这个问题。


image.png




相关文章
|
1月前
|
计算机视觉 Python
解决 NoneType‘ object has no attribute ‘astype’ 问题
解决 NoneType‘ object has no attribute ‘astype’ 问题
29 0
|
5月前
|
存储 JSON 数据格式
数据集加载时报错'dict' object has no attribute 'requests‘
数据集加载时报错'dict' object has no attribute 'requests‘
107 5
|
3月前
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
AttributeError: 'NoneType' object has no attribute 'to_capabilities'
364 0
|
3月前
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
92 0
|
4月前
|
数据采集
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
运行爬虫时报错AttributeError—— 'str' object has no attribute 'capabilities'
246 0
|
4月前
'WebDriver' object has no attribute 'find_element_by_tag_name'
'WebDriver' object has no attribute 'find_element_by_tag_name'
118 0
|
3天前
|
数据处理 Python
如何使用Python的Pandas库进行数据排序和排名
【4月更文挑战第22天】Pandas Python库提供数据排序和排名功能。使用`sort_values()`按列进行升序或降序排序,如`df.sort_values(by='A', ascending=False)`。`rank()`函数用于计算排名,如`df['A'].rank(ascending=False)`。多列操作可传入列名列表,如`df.sort_values(by=['A', 'B'], ascending=[True, False])`和分别对'A'、'B'列排名。
13 2
|
1月前
|
数据格式 Python
如何使用Python的Pandas库进行数据透视图(melt/cast)操作?
Pandas的`melt()`和`pivot()`函数用于数据透视。基本步骤:导入pandas,创建DataFrame,然后使用这两个函数转换数据格式。示例代码展示了如何通过`melt()`转为长格式,再用`pivot()`恢复为宽格式。输入数据是包含'Name'和'Age'列的DataFrame,最终结果经过转换后呈现出不同的布局。
40 6
|
1月前
|
数据处理 Python
如何使用Python的Pandas库进行数据排序和排名?
Pandas在Python中提供数据排序和排名功能。使用`sort_values()`进行排序,如`df.sort_values(by='A', ascending=False)`进行降序排序;用`rank()`进行排名,如`df['A'].rank(ascending=False)`进行降序排名。多列操作可传入列名列表,如`df.sort_values(by=['A', 'B'], ascending=[True, False])`。
24 6
|
1月前
|
BI 数据处理 索引
Pandas基本操作:Series和DataFrame(Python)
Pandas基本操作:Series和DataFrame(Python)
103 1