Force import module from Python standard library instead of PYTHONPATH default

Posted by jrdioko on Stack Overflow See other posts from Stack Overflow or by jrdioko
Published on 2010-06-01T17:56:26Z Indexed on 2010/06/01 18:13 UTC
Read the original article Hit count: 342

I have a custom module in one of the directories in my PYTHONPATH with the same name as one of the standard library modules, so that when I import module_name, that module gets loaded. If I want to use the original standard library module, is there any way to force Python to import from the standard library rather than from the PYTHONPATH directory, short of renaming the custom module and changing every reference to point to the new name?

© Stack Overflow or respective owner

Related posts about python

Related posts about import