且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

导入 httplib 导入错误:没有名为 httplib 的模块

更新时间:2022-10-31 18:39:13

您正在 Python 3 上运行 Python 2 代码.在 Python 3 中,该模块已重命名为 http.client.

You are running Python 2 code on Python 3. In Python 3, the module has been renamed to http.client.

您可以尝试运行 2to3工具,并尝试让它自动翻译.对 httplib 的引用将自动改写为使用 http.client.

You could try to run the 2to3 tool on your code, and try to have it translated automatically. References to httplib will automatically be rewritten to use http.client instead.