安装sklearn-poter遇到报错(TypeError:‘encoding‘ is an invalid keyword argument for this function)
问题:
在python2.7环境下进行sklearn-poter模块的安装的时候报错如下:
解决方法1:(未尝试)
遇到错查度娘,建议升级:
升级pip:python -m pip install --upgrade pip
升级setuptools:python -m pip install --upgrade setuptools
需要安装Visual C++ 14.0 ~.~
本人感觉有点繁琐啊!大家想尝试转参考连接:https://zhuanlan.zhihu.com/p/89858202
新的解决方法:
吐血建议:要多看看自己的报错,不要只看最后一行就跟着网上的解决方案一顿乱搞。
看完报错之后感觉应该是安装源的问题,于是换了安装源为豆瓣,但是还报同样的错误;
于是下载源代码进行安装:https://github.com/nok/sklearn-porter
(1)解压
(2)cd 到解压好的目录下
(3)python setup.py install
进行源码安装的时候继续报错:通过改代码进行修复吧~~~
参考:https://blog.csdn.net/a1007720052/article/details/80745135
python2 解决TypeError: 'encoding' is an invalid keyword argument for this function
环境:python2.7
代码示例:
with open('1.txt','r',encoding='utf-8') as f:
lines = f.readlines()
for line in lines:
line =line.strip()
使用with open() as f 语句提示错误:
TypeError: 'encoding' is an invalid keyword argument for this function
解决办法:
找到报错的源码,对源码中报错的地方进行修改:
import io
with io.open('1.txt','r',encoding='utf-8') as f:
lines = f.readlines()
for line in lines:
line =line.strip()
安装成功!!!!!!!!!!!!!!
安装sklearn-poter遇到报错(TypeError:‘encoding‘ is an invalid keyword argument for this function)相关推荐
- 成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: 'encoding' is an invalid keyword argument for this function 目录 解决问题 解决思路 解决方法 解决问题 Ty ...
- python3 报错 TypeError: load() got an unexpected keyword argument ‘encoding‘ 解决方法
目录 错误现象 错误原因 解决方法 错误现象 错误原因 python3中不需要encoding,python2和python3的差别 解决方法 在python3中把 encoding删掉
- anaconda下安装新包一直报错(‘parse() got an unexpected keyword argument 'transport_encoding'’)...
pip没有更新 解决方案:在prompt上输入 " conda install pip " 转载于:https://www.cnblogs.com/Li---Chao/p/8641 ...
- jupyter 无法提示代码,报错TypeError: __init__() got an unexpected keyword argument ‘column‘
解决方法 这是由于jedi这个库版本太高导致的不兼容,所以降一下版本即可: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jedi= ...
- django报错TypeError: __init__() missing 1 required positional argument: 'on_delete'
个人博客页面链接:http://www.shihao.online (django搭建的个人博客,还在完善中) django报错 TypeError: __init__() missing 1 req ...
- 安装Windows补丁KB947821报错0x8007000d The data is invalid
背景: 域内有一个Windows Server的成员服务器需要安装补丁KB947821,安装补丁过程中一直报错0x8007000d The data is invalid. 排错过程: 使用命令行wu ...
- python 调用super()初始化报错“TypeError: super() takes at least 1 argument”
在python中有如下代码: class father():def __init__(self,age):self.age = age;def get_age(self):print(self.age ...
- python 函数继承调用super()初始化报错“TypeError: super() takes at least 1 argument”
在python中有如下代码: class father():def __init__(self,age):self.age = agedef get_age(self):print(self.age) ...
- 使用scrapy报错:attrs() got an unexpected keyword argument 'eq'解决办法
使用scrapy的时候报错attrs() got an unexpected keyword argument 'eq',在百度和bing上面找了一圈没找到解决方法,最后在谷歌上找到了,出现这个问题的 ...
最新文章
- iOS NSArray数组过滤
- java正则表达式 引用_java – 正则表达式检索引用的字符串和引用字符
- 做技术的,聊聊研发。
- 平流式隔油池计算_海淀区平流式隔油池厂家供货
- markdownFormat
- 拓客系统专用服务器,北京拓客系统
- HNOI2013 切糕
- 如何实现和提升软件易用性
- 服务器安全防护和保护措施方案-数据湾
- NAT下网络流量监控解决方案
- Day05——综合任务1、顺序表
- WIN7 通知栏处喇叭上有个小红叉,提示未插入“未插入扬声器或耳机”的解决方法
- 实战技法 - 短线操盘 (9)
- 关于ADB需要知道的一些知识
- Semi-Supervised Semantic Segmentation with Cross-Consistency Training论文笔记
- Spark获取CSV文件导入ClickHouse
- 借助支付宝实现跨行跨省转账无手续费
- 数据库查询语句遇到:Unknown column ‘XXXX‘ in ‘where clause‘解决方法
- 平面、3D设计软件最全集子(Windows系32、64位)
- 超级好用的7个程序员笔记软件,你最常用的是哪个?