且构网

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

从Python标准库强制导入模块而不是PYTHONPATH默认值

更新时间:2023-11-08 16:04:16

理想的解决方案是将模块重命名为非标准库中的模块。

The ideal solution would be to rename your module to something not in the standard library.

您还可以切换绝对导入如果您使用的是Python 2.5 +:

You can also switch absolute imports on if you're on Python 2.5+:

from __future__ import absolute_import