DeprecationWarning
当我在导入sklearn这个库的时候,程序抛出了一个丢弃警告,它的意思是在版本更新后imp库已经不用了,用importlib来代替这个库
Warning (from warnings module):
File "C:\Users\33171\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py", line 47
import imp
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
因此解决方案就是把它的文件路径copy下来,C:\Users\33171\AppData\Local\Programs\Python\Python37\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle
打开它,然后把cloudpickle.py文件里面的
import imp -->改成 import importlib
from __future__ import print_function import dis
from functools import partial
import importlib #更改之前是 import imp
import io
import itertools
import logging
import opcode
import operator
import pickle
import struct
import sys
import traceback
import types
import weakref
预览
DeprecationWarning的更多相关文章
- 解决: DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19
错误信息:C:\Python27\lib\site-packages\sklearn\utils\validation.py:395: DeprecationWarning: Passing 1d a ...
- DeprecationWarning: Calling an asynchronous function without callback is deprecated. - how to find where the “function:” is?
I recently updated my node to 7.2.1 and noticed that there is a warning coming: (node:4346) Deprecat ...
- Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法
Python提示AttributeError 或者DeprecationWarning: This module was deprecated解决方法 在使用Python的sklearn库时,发现sk ...
- DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead extract-text-webpack-plugin 提取css报错
深入浅出Webpack 1-5 使用pulugin extract-text-webpack-plugin 提取css报错 DeprecationWarning: Tapable.plugin is ...
- 解决如下出错:DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and willraise ValueError in 0.19.
背景:在Spyder中写几行脚本,目的是应用sklearn自带的svm(支持向量机)算法,来对其自带的digits(手写体数字)数据集进行分类,过程包括训练阶段和预测阶段.将手写体数字数据的特征数据d ...
- node.js开发错误——DeprecationWarning: Mongoose: mpromise
原文地址 使用mongoose进行数据库操作时,总是提示: (node:5684) DeprecationWarning: Mongoose: mpromise (mongoose's default ...
- [未解决]报错:DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()
DeprecationWarning: decodestring() is a deprecated alias since Python 3.1, use decodebytes()
- mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
mongoose报错:(node:15689) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes ...
- DeprecationWarning:'open()' is deprecated in mongoose>=4.11.0,use 'openUri()' instead or set the 'useMongoClient' option if using 'connect()' or 'createConnection'
mongoose.connect('mongodb://localhost/test');报错:(node:2752) DeprecationWarning: `open()` is deprecat ...
随机推荐
- s21day14 python笔记
s21day14 python笔记 一.内容回顾及补充 参数补充 对于函数的默认值是可变类型 # 如果要想给value设置默认是空列表 # 不推荐(坑) def func(data,value=[]) ...
- Dart 中dynamic 的使用
void main(){ var a; a=10; b ="Dart"; dynamic b =20; b ="JavaScript" var list =ne ...
- as 报错
报错: cantnot find the declaration of element 'LinearLayout' 解决: 原本为了解决报错我把Android support关掉了,然后百度到解决办 ...
- ubuntu18安装网易云音乐
1.打开ubuntu软件搜索网易云安装 2.解决ubuntu18.04下网易云音乐打不开的问题 修改/etc/sudoers文件 sudo vi /etc/sudoers 在最后增加一行: usern ...
- javascript中正则动态替换为对象中的相应数据
使用正则进行替换以下内容 var str = 'aKey={aValue}&bKey={bValue}' 使用以下对象数据,替换value var obj = { aValue: 1, bVa ...
- VS 2017 + opencv4.0
完全参考这一文章, 非常详细: https://blog.csdn.net/qq_41175905/article/details/80560429 记录自己遇到的问题: 1. VS 2017 专业版 ...
- edgedb 内部pg 数据存储的探索 (一)基本环境搭建
edgedb 是基于pg 上的对象关系数据库,已经写过使用docker 运行的demo,为了探索内部的原理,做了一下尝试,开启pg 访问 后边会进一步的学习 环境准备 为了测试,使用yum 安装 安装 ...
- day01代码
1. 使用while循环打印1,2,3,4,5,7,8,9 # 使用while循环打印1,2,3,4,5,7,8,9 count = 0 while count < 10: count += 1 ...
- Spring Boot 全局异常处理
Spring Boot版本 1.5 @ControllerAdvice public class GlobalExceptionHandler extends ResponseEntityExcept ...
- QPainter绘制遇到的小问题
1.Qt绘图基础 (1)绘图需画笔和画布: QPainter 相当于Qt中的一个画笔,绘制时需要一块画布, Qt中扮演画布角色的组件为QPaintDevice和他的各个子类,如: QWidget, Q ...