'python' engine because the 'c' engine does not support regex separators

2018-10-2 孤独求学人 Python

moveielens.py:17: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
  user = pd.read_table(path1, sep='::', header=None, names=unames)

  pandas.read_table()函数,读取文件数据时,由于分隔符为'::',弹出如下警告
       警告:ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex)
       解决方法:增加函数的引擎参数engine='python',如下:

    user = pd.read_table(path1, sep='::', header=None, names=unames, engine='python')

阅读全文>>

标签: python pandas re read_table

评论(0) 浏览(3043)

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) 浏览(2017)

Powered by emlog 豫ICP备15004178号-1