shell调用python脚本出现了这个问题,查询原因得知,python脚本是python3.6写的,我们服务器上默认的python是python2.7.3,所以会出现编码问题。

解决思路:

  1.安装python3,然后python3调用

或者

  2.更改python脚本,https://blog.csdn.net/a1007720052/article/details/80745135

python TypeError: ‘encoding’ is an invalid keyword argument for this function的更多相关文章

  1. python 2.7版本解决TypeError: 'encoding' is an invalid keyword argument for this function

    今天在用yaml处理数据时,由于yaml.load可接收一个byte字符串,unicode字符串,打开的二进制文件或文本文件对象,但字节字符串和文件必须是utf-8,utf-16-be或utf-16- ...

  2. TypeError: 'encoding' is an invalid keyword argument for this function 解决Python 2.7

    在python2.7中这样调用代码 open('file/name.txt','r',encoding= 'utf-8').read() 会出现 TypeError: 'encoding' is an ...

  3. TypeError: 'encoding' is an invalid keyword argument for this function

    python 2.7 问题 data_file = open("F:\\MyPro\\data.yaml", "r", encoding='utf-8') 运行 ...

  4. TypeError: 'newline' is an invalid keyword argument for this function 错误解决

    出错代码: outputFile = open('output1.csv', 'w', newline='') # error line outputWriter = csv.writer(outpu ...

  5. Python pika, TypeError: exchange_declare() got an unexpected keyword argument 'type' 问题修复

    网上很多写法都是 type='fanout' 这样的.(这里是基于python=3.6版本, pika=0.13.0 版本) credentials = pika.PlainCredentials(' ...

  6. TypeError: parse() got an unexpected keyword argument 'transport_encoding'

    错误: TypeError: parse() got an unexpected keyword argument 'transport_encoding'You are using pip vers ...

  7. TypeError: __init__() got an unexpected keyword argument 't_command'

    python  .\manage.py migrate 报错如下 λ python .\manage.py migrateTraceback (most recent call last): File ...

  8. TypeError: pivot_table() got an unexpected keyword argument 'rows'

    利用Python进行数据分析>第二章,处理MovieLens 1M数据集,有句代码总是报错: mean_rating = data.pivot_table('rating', rows='tit ...

  9. TypeError: __init__() got an unexpected keyword argument 'serialized_options'

    问题描述: TypeError: __init__() got an unexpected keyword argument 'serialized_options' File "objec ...

随机推荐

  1. jsp中jstl、el使用

    tomcat7.0+JSTL1.1.2(不冲突) EL表达式获取变量 ${表达式} 如:${user.name} 不可以动态取值 ${user[name]}可以动态取值,变量名中含有特殊字符时只能用此 ...

  2. upc组队赛3 Iranian ChamPions Cup

    Iranian ChamPions Cup 题目描述 The Iranian ChamPions Cup (ICPC), the most prestigious football league in ...

  3. CPython,PyPy?Python和这两个东西有什么关系

    https://blog.csdn.net/fu6543210/article/details/90770794 python是一种编程语言.但这种语言有多种实现,而且与其他语言不同,python并没 ...

  4. overflow:hidden失效

    overflow:hidden失效 为了页面的健壮性,我们常常需要使用overflow:hidden.有时候是为了防止布局被撑开,有时候是为了配合其它规则实现文字截断,还有时候纯粹是为了创建块级上下文 ...

  5. python调用tushare获取沪深A股票资金流向数据

    接口:moneyflow 描述:获取沪深A股票资金流向数据,分析大单小单成交情况,用于判别资金动向 限量:单次最大提取4000行记录,总量不限制 积分:用户需要至少1500积分才可以调取,基础积分有流 ...

  6. linux下samba共享服务器搭建详解

    这两天业务需求搭了一台服务器.要求samba共享文件. 葡萄美酒月光杯的前戏就省了,我们直接上干货. 1.yum方式安装samba yum  -y  install samba 2.将/etc/sam ...

  7. linux 之文件重命名

    没有专门的重命名 命令 用 mv a b 就可以重命名了 mv :move 移动文件(延伸功能:重命名,linux系统没有专门的重命名命令) 基本格式: 移动文件:mv 文件名 移动目的地文件名 重命 ...

  8. 例行性工作排程 (crontab)

    说白了,就是一些例行工作的日常执行的排序程序 Linux  工作排程的种类:  at,cron 鸟叔说,atd并不是在所有版本都是开启的,但是centos7默认是开启的 [root@localhost ...

  9. 【学术篇】NOI2015 品酒大会 后缀数组+并查集

    省选前大致是刷不了几道题了... 所以就找一些裸一点的题目练练板子算了= = 然而这题一点都不裸, 也并不怎么好写... 于是就浪费了将近一下午的时间... 然而还不是因为后缀数组板子不熟= = 首先 ...

  10. 从 Server Timing Header 看服务器是如何处理请求的

    原文作者:Florian Hämmerle      译者:UC 国际研发 Jothy   写在最前:欢迎你来到“UC国际技术”公众号,我们将为大家提供与客户端.服务端.算法.测试.数据.前端等相关的 ...