标签:文件 display file code nta dep pes -- color
当我在导入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
标签:文件 display file code nta dep pes -- color
原文地址:https://www.cnblogs.com/vvlj/p/10014140.html