如何修复蟒蛇蛋?
我通过导入 xmppy 库为我的 python 机器人添加了 jabber 支持。 然而,调用“import xmpp”会引起一些警告:
/usr/lib/python2.6/site-packages/xmpp/auth.py:24: DeprecationWarning:sha 模块是 已弃用;使用 hashlib 模块 而是导入 sha,base64,随机,调度程序,re /usr/lib/python2.6/site-packages/xmpp/auth.py:26: DeprecationWarning:md5 模块是 已弃用;使用 hashlib 代替 import md5 如果能解决这个问题就好了...
我想我可以通过解压缩鸡蛋、修复模块导入并重新压缩它来解决这个问题。 然而,在我运行之后,python 无法识别该库。我收到*模块未找到*错误。修复鸡蛋的**真正**方法是什么?
I added a jabber support to my python bot by importing the xmppy library.
However calling "import xmpp" attracts a few warnings:
/usr/lib/python2.6/site-packages/xmpp/auth.py:24:
DeprecationWarning: the sha module is
deprecated; use the hashlib module
instead import
sha,base64,random,dispatcher,re
/usr/lib/python2.6/site-packages/xmpp/auth.py:26:
DeprecationWarning: the md5 module is
deprecated; use hashlib instead import
md5 it will be nice to fix this...
I thought I would fix this by unzipping the egg, fixing the module imports and rezipping it.
After my operating however python does not recognize the library. I am getting *module not found* error. What is the **real** way of fixing an egg?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您在上面看到的消息只是一些警告, DeprecationWarning 确切地说,这意味着 xmpp 库使用的某些模块已被弃用(旧模块将在新版本的 python 中删除,因此它们应该被新模块替换),并且您不应该尝试修复它,这不是你的代码:)。
所以我建议重新安装你的xmpp库,如果有新版本,也许它会是最新的,所以警告不会出现,如果不只是使用它,你没有太多选择,除非你使用另一个图书馆 。
编辑:弃用警告是有意义的,您不应该禁用它们,但如果您必须查看此处。
希望有帮助。
First of all the message that you saw above are just some warning, DeprecationWarning to be exact that mean that some of the module that xmpp library use are deprecate (old module that will be remove in new version of python so they should be replaced by the new ones), and you shouldn't try to fix it, it's not your code :) .
So i will suggest to reinstall your xmpp library , if there is a new version maybe it will be up to date so the warning will not be there , if not just work with it , you don't have much choice, unless you use another library .
EDIT: The Deprecate warning have a meaning , you shouldn't disable them but if you must look here.
Hope it help .