[arch-general] python2: Where is imp.py?

Peter Nabbefeld peter.nabbefeld at gmx.de
Sun Dec 30 23:19:52 UTC 2018



Am 30.12.18 um 23:06 schrieb Eli Schwartz via arch-general:
> On 12/30/18 4:04 PM, Peter Nabbefeld wrote:
>> Hello,
>>
>> I need to use the inspect module with python 2.7, but the imported imp
>> module seems to be missing - how can I get that, as there's no
>> python2-imp package?
> That's categorically impossible as the imp module is a builtin in
> python2 and imp.py is a (deprecated!) part of the stdlib in python3.
>
> You should definitely be able to "import imp". Please explain your
> problem further.
>
I try to use the inspect module with jython, but the import of imp fails.

inspect.py exists in /usr/lib/python2.7 (and also in 
/usr/lib/python3.7), while imp.py exists only in /usr/lib/python3.7

If it's a builtin in python2, it seems I have bad luck, though.

Kind regards

Peter


More information about the arch-general mailing list