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 ...
随机推荐
- 服务端渲染时无法获得环境变量的值,一直是undefined
1.服务端渲染时无法获得环境变量的值,一直是undefined 2.ngnix做代理以后无法无法获取node设置的cookie
- Shell脚本中的逻辑判断、文件目录属性判断、if的特殊用法、case判断
1.Shell脚本中的逻辑判断 格式1:if 条件 ; then 语句; fi格式2:if 条件; then 语句; else 语句; fi格式3:if …; then … ;elif …; then ...
- fdsafdsafds
name1 = input('请输入一个名字:') name2 = input('请输入一个名字: ') animal = input('请输入一个名字 :') print('刚按完摩的{}出门看见{ ...
- 作业二:构建swap函数
一.swap代码 #include<stdio.h> int main() //主函数部分 { void swap(int *m,int *n); int a,b; int *p1,*p2 ...
- jQuery之基础核心(demo)
jQuery之基础核心 作者的热门手记 jQuery之基础核心(demo) 本文主要简单的介绍下jQuery一些基础核心,大致了解jQuery使用模式.适用于有HTML.CSS.javas ...
- buildroot管理uboot+kernel+rootfs
鉴于自己制作根文件系统太麻烦了,所以想用buildroot管理uboot,kernel,另外还可以自动生产rootfs,于是花了两天研究了下buildroot的框架和使用,在自己的2440开发板上也跑 ...
- Actifio OnVault 8.0
- 单机版Kubernetes集群(一)
环境:CentOS Linux release 7.4.1708 (Core) 单机版Kubernetes集群的效果,如图: 1)JSP页面通过JDBC直接访问Mysql数据库并展示:这里只是为了 ...
- HTTP 客户端接收数据超时
本文使用两种方式测试HTTP 客户端读数据超时的情况,一种是直接使用golang自带的http库,另一种是使用martini web框架. 1. 测试1--直接使用http库 1.1.启动server ...
- 剑指offer 9.递归和循环 变态跳台阶
题目描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级.求该青蛙跳上一个n级的台阶总共有多少种跳法. 这道题还是编程题? 数学渣渣看到心拔凉拔凉的, 要用到数学归纳法来 ...