不推荐使用 imp 模块 [英] The imp module is deprecated

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

问题描述

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

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

DeprecationWarning:imp 模块被弃用,取而代之的是 importlib;有关其他用途,请参阅模块的文档导入导入

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

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天全站免登陆