The imp module is deprecated(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 模块已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:imp 模块已弃用


基础教程推荐
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 筛选NumPy数组 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01