imp 模块已弃用 [英] The imp module is deprecated

查看:78
本文介绍了imp 模块已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试使用sklearn"时在 PyCharm 中,我在控制台上收到以下错误.

Whenever I try to use "sklearn" in PyCharm, I get the following error on the console.

DeprecationWarning:不推荐使用 imp 模块以支持 importlib;请参阅模块的文档以了解其他用途进口小鬼

DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp

我不确定它是否应该打扰我,因为程序仍在运行,但它很烦人.我怎样才能摆脱它?

I am not sure if it should bother me, because program still working, but it's annoying. How can I get rid of it?

我做了所有的改变,人们在链接的问题中推荐,但错误仍然存​​在.

I made every change, people recommended in linked question but the error is still there.

推荐答案

我从cloudpickle.py"中删除了导入imp"的代码警告消失了,但我希望我没有搞砸任何事情.您也可以简单地忽略它,因为它不是错误.

I deleted the code that imports "imp", from "cloudpickle.py" and the warning is gone but I hope I didn't mess up anything. You can also simply ignore this, since it's not an error.

我不想删除问题或答案,因为人们仍在访问此页面,但这不是解决方案,而且处理它的方法很糟糕,请忽略此警告.我在非常业余的日子里这样做了,对不起:(

I don't want to remove the question or answer because people still visit this page but this is not a solution and it is a bad way to handle it, just ignore this warning. I did this in my very amateur days, sorry :(

这篇关于imp 模块已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆