python3往这个库中加入了一些新的内容,使得该库在Python2.7中报错。

解决方法是将导入语句

from io import StringIO as StringIO

更换为:

from io import BytesIO as StringIO
 

Python2.7 在使用BSTestRunner.py时报错TypeError: unicode argument expected, got 'str'的更多相关文章

  1. statsmodels.tsa.arima_model预测时报错TypeError: int() argument must be a string, a bytes-like object or a number, not 'Timestamp'

    在 python 中用 statsmodels创建 ARIMA 模型进行预测时间序列: import pandas as pd import statsmodels.api as sm df = pd ...

  2. Ajax上传文件/照片时报错TypeError :Illegal invocation

    问题 Ajax上传文件/照片时报错TypeError :Illegal invocation 解决 网上搜索问题,错误原因可能有以下几个,依次检查: 请求类型有误,如post请求,但在后台设置的是ge ...

  3. appium 提示报错“TypeError: 'unicode' object is not callable”的解决方式!

    这里提到的这个报错,是小错误且容易经常会犯,有时需要特别注意使用. 目的要求结果:根据某个元素的id值获取到对应id的text值,并且将获取的text值与本身存在的text值做比较,查看text值是否 ...

  4. 执行python manage.py makemigrations时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

    在执行python manage.py makemigrations时报错: TypeError: __init__() missing 1 required positional argument: ...

  5. Django :执行 python manage.py makemigrations 时报错 TypeError: __init__() missing 1 required positional argument: 'on_delete'

    原因 执行命令 python manage.py makemigrations 报错 TypeError: __init__() missing 1 required positional argum ...

  6. 部署安装kubernetes client-python,执行pip install setup.py时报错

    之前在本地安装过kubernetes的python库,安装下来一切正常,但今天换到测试机器上去部署,确保错了,具体步骤如下. 第一步,克隆代码,执行以下命令:    # git clone --rec ...

  7. facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' object has no attribute 'iteritems'

    报错原因:在进行facenet进行train_softmax.py训练时,在一轮训练结束进行验证时,报错AttributeError: 'dict' object has no attribute ' ...

  8. moviepy执行TextClip.search方法时报错TypeError: a bytes-like object is required, not str

    ☞ ░ 前往老猿Python博文目录 ░ 执行TextClip.search方法时,报错: >>> from moviepy.editor import * >>> ...

  9. Django关联数据库时报错TypeError: __init__() missing 1 required positional argument: 'on_delete'

    sgrade = models.ForeignKey("Grades",) 执行python manage.py makemigrations后出现TypeError: __ini ...

随机推荐

  1. activity fragment 传值

    Bundle bundle = new Bundle(); bundle.putString("key","value"); fragment.setArgum ...

  2. VLAN-1-VLAN配置

    f0/12和f0/24不在列表中,因为它们动态地成为trunk,支持多个vlan       “unsup”意为这个2950交换机不支持FDDI和TR       首先 switchport mode ...

  3. python入门之实例-验证码

    需求: 随机生成6位的验证码,要求有字母和数字 import random temp = "" for i in range(6): j = random.randrange(0, ...

  4. Retrofit实现Delete请求

    //设置取消关注 @Headers("Content-Type:application/x-www-form-urlencoded") @HTTP(method = "D ...

  5. Spark Mllib里如何将trainDara训练数据文件里提取第M到第N字段(图文详解)

    不多说,直接上干货! 具体,见 Hadoop+Spark大数据巨量分析与机器学习整合开发实战的第13章 使用决策树二元分类算法来预测分类StumbleUpon数据集

  6. git 设置了ssh key 还是需要输入账户和密码

    参考这篇文章https://blog.csdn.net/shahuhu000/article/details/86625987 git remote remove origingit remote a ...

  7. 电脑上文件的后缀名被隐藏,把一个文本文件改成.bat时,默认打开的还是文本。

    1.打开文件夹,选择组织,点击“文件夹和搜索选项”,如图: 2.选择“查看”,找到“隐藏已知文件类型的扩展名”,不要勾选这一项,如图: 3.点击“确定”或者“应用”

  8. 毛毛虫组【Beta】Scrum Meeting 3

    第三天 日期:2019/6/25 前言 第三次会议: 时间:6月25日 地点:教10-A511 内容:此次会议主要是对项目验收做准备工作. 1.1 今日完成任务情况以及遇到的问题. 今日完成任务情况: ...

  9. Luogu P2397 yyy loves Maths VI (mode)

    题目传送门 虽然只是一道黄题,但还是学到了一点新知识-- 摩尔投票法 用\(O(1)\)的内存,\(O(n)\)的时间来找出一串长度为n的数中的众数,前提是众数出现的次数要大于\(n/2\) 方法很简 ...

  10. ThinkPHP5.0-多语言切换

    这两天做得项目中需要多语言切换,于是乎就看了看文档,感觉有些乱,就使用了终极必杀--百度. 借鉴了网上各位大佬所集成.整理出一篇比较适合类似我这种比较菜的随笔吧. 请各位大佬轻虐.感谢. 首先,不说其 ...