importError c extension: No module named np_datetine not buit

2018-10-1 杜世伟 Python

我的python代码中有

import pandas

使用pyinstaller进行打包exe的时候出现以下问题,现在就来说一下。
打包的时候没有报错,

但是执行时候首先报了pandas的错。提示没有找到pandas._lilbs.tslibs.np_datetime。大概的错误如下:

第一个错误是:

Fi1e sitepackagesp\pandas\init .py 1ine 35 in Kmodule?

importError c extension: No module named np_datetine not buit. Jf you yant to import pandas from. the source drectory

g you may need to run python setup. py buildext inplace force to bui1d the c extensions first:

iFai1ed to execute script smg



通过网上查找的方法,修改下pyinstaller的用法,生成过程中添加--hiddenimport=pandas._libs.tslibs.np_datetime,代码如下

pyinstaller -F -w smg.py  --hiddenimport=pandas._libs.tslibs.np_datetime

继续打包,过程中没有报错,继续执行exe文件的时候报错如下

第二个错误:
Fi1e sitepackagesp\pandas\init .py 1ine 35 in Kmodule?

Fi1e sitepackagesp\pandas\init .py 1ine 35 in Kmodule?

importError c extension: No module named timedeltas not buit. Jf you yant to import pandas from. the source drectory

g you may need to run python setup. py buildext inplace force to bui1d the c extensions first:

iFai1ed to execute script smg

iFai1ed to execute script smg

阅读全文>>

标签: pandas np_datetime timedeltas

评论(0) 浏览(2819)

Powered by emlog 沪ICP备2023034538号-1