当前位置: 首页 > news >正文

国外自适应网站模版宿迁网站建设价格

国外自适应网站模版,宿迁网站建设价格,建设银行官方网站客户端,北辰网站建设公司太原网站制作目录 背景尝试1: pymysql模块的escape_string方法尝试2: 修改pandas.read_excel引擎尝试3: 回退xlrd版本总结 背景 在Linux上部署的时候, 使用pandas模块读取Excel, 然后pymysql模块入库, 结果发生了错误 Traceback (most recent call last):File /usr/local/lib64/pyth… 目录 背景尝试1: pymysql模块的escape_string方法尝试2: 修改pandas.read_excel引擎尝试3: 回退xlrd版本总结 背景 在Linux上部署的时候, 使用pandas模块读取Excel, 然后pymysql模块入库, 结果发生了错误 Traceback (most recent call last):File /usr/local/lib64/python3.6/site-packages/tornado/web.py, line 1702, in _executeresult method(*self.path_args, **self.path_kwargs)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1135, in postself._replyPrivateMessage(message)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1221, in _replyPrivateMessageself._junming(filepath)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1263, in _junmingsdk.mysql(config.db_qihua).insmany(qihua.log_bjmantis_cost,data_db)File /root/.jenkins/workspace/git_python_web_linux/sdk.py, line 65, in insmanyself._cur.executemany(sqlInsert,listTuple)File /usr/local/lib64/python3.6/site-packages/pymysql/cursors.py, line 182, in executemanyself.rowcount sum(self.execute(query, arg) for arg in args)File /usr/local/lib64/python3.6/site-packages/pymysql/cursors.py, line 182, in genexprself.rowcount sum(self.execute(query, arg) for arg in args)File /usr/local/lib64/python3.6/site-packages/pymysql/cursors.py, line 146, in executequery self.mogrify(query, args)File /usr/local/lib64/python3.6/site-packages/pymysql/cursors.py, line 125, in mogrifyquery query % self._escape_args(args, conn)TypeError: not all arguments converted during string formatting尝试1: pymysql模块的escape_string方法 from pymysql.converters import escape_string ... data_database [escape_string(x) for x in data] ...还是报错, 所以应该不是字符的问题. 打印出来肉眼观察, 也没有字符问题 尝试2: 修改pandas.read_excel引擎 修改引擎, 是可以解决字符问题, 但出现了新的问题 ... excel pandas.read_excel(filepath, engineopenpyxl) ...正常入库. 但是, 无法读取xls文件 Traceback (most recent call last):File /usr/local/lib64/python3.6/site-packages/tornado/web.py, line 1702, in _executeresult method(*self.path_args, **self.path_kwargs)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1135, in postself._replyPrivateMessage(message)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1224, in _replyPrivateMessageself._qingzhilan(filepath)File /root/.jenkins/workspace/git_python_web_linux/handler.py, line 1296, in _qingzhilandf pandas.read_excel(filepath,sheet_name[Sheet1], engineopenpyxl)File /usr/local/lib64/python3.6/site-packages/pandas/util/_decorators.py, line 296, in wrapperreturn func(*args, **kwargs)File /usr/local/lib64/python3.6/site-packages/pandas/io/excel/_base.py, line 304, in read_excelio ExcelFile(io, engineengine)File /usr/local/lib64/python3.6/site-packages/pandas/io/excel/_base.py, line 867, in __init__self._reader self._engines[engine](self._io)File /usr/local/lib64/python3.6/site-packages/pandas/io/excel/_openpyxl.py, line 480, in __init__super().__init__(filepath_or_buffer)File /usr/local/lib64/python3.6/site-packages/pandas/io/excel/_base.py, line 353, in __init__self.book self.load_workbook(filepath_or_buffer)File /usr/local/lib64/python3.6/site-packages/pandas/io/excel/_openpyxl.py, line 492, in load_workbookfilepath_or_buffer, read_onlyTrue, data_onlyTrue, keep_linksFalseFile /usr/local/lib/python3.6/site-packages/openpyxl/reader/excel.py, line 345, in load_workbookdata_only, keep_links, rich_text)File /usr/local/lib/python3.6/site-packages/openpyxl/reader/excel.py, line 123, in __init__self.archive _validate_archive(fn)File /usr/local/lib/python3.6/site-packages/openpyxl/reader/excel.py, line 93, in _validate_archiveraise InvalidFileException(msg)openpyxl.utils.exceptions.InvalidFileException: openpyxl does not support the old .xls file format, please use xlrd to read this file, or convert it to the more recent .xlsx file format.尝试3: 回退xlrd版本 注: Linux平台上默认应该用pip3替代pip pip list | grep xlrd # 查看现有xlrd版本 # pip list | findstr xlrd ## Windows平台查包 pip uninstall xlrd # 卸载包 pip install xlrd1.2.0 # 安装包回退到1.2.0版本后我之前遇到的错误消失了。我的代码再次可以正常运行我能够继续我的数据分析工作。 总结 Linux平台使用pandas.read_excel并且可能会有xls和xlsx格式的话, 建议回退xlrd版本到1.2.0来解决字符和格式问题
http://www.w-s-a.com/news/977584/

相关文章:

  • net域名 著名网站国外设计案例网站
  • 淘宝客网站哪里可以做app地推网
  • 宜昌建设厅网站中国最新时事新闻
  • 微网站怎么开发wordpress 发表评论
  • 山东网站建设是什么一页网站首页图如何做
  • 游戏开发与网站开发哪个难万网影
  • 做网站编程语言建筑施工特种证书查询
  • 找人做网站内容自己编辑吗修改wordpress登陆界面
  • 登陆建设银行wap网站湖南网站建设磐石网络答疑
  • 58网站怎么做浏览度才高论坛网站怎么做排名
  • wordpress 手机网站支付京东网站建设的经费预算
  • 自己怎么样做游戏网站做海外贸易网站
  • 建立什么样的网站好制作网页网站代码
  • 岳麓区专业的建设网站公司尚一网常德论坛
  • 电商网站建设实训报告360站长平台链接提交
  • 个性化网站建设公司个人网站备案类型
  • 腾讯建站模板上海网站开发有限公司
  • 网站和小程序的区别请问做网站怎么赚钱
  • 网站logo设计免费版在线网站开发建设准备工作
  • wordpress多站点 主题南京做网站好的公司
  • 广州 门户seo到底是做什么的
  • 可以登录国外网站吗如何用家用电脑做网站
  • 吉安建站公司wordpress企业
  • 河北住房和城乡建设厅网站6thinkphp做视频网站
  • 遵义网站制作一般需要多少钱深圳全国网站制作哪个好
  • 公众平台网站价格哪个网站做餐饮推广最好
  • 深圳 公司网站设计重庆的网站设计公司价格
  • 网站开发市场分析餐饮平台app有哪些
  • 制作一个收费网站要多少钱开发网站需要什么技术
  • 网站流量统计平台二手域名做网站不收录