This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Inspect module broken
Type: Stage:
Components: Versions: Python 3.3
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: beruic, zach.ware
Priority: normal Keywords:

Created on 2013-12-10 14:49 by beruic, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg205818 - (view) Author: Jimmy Merrild Krag (beruic) Date: 2013-12-10 14:49
I have been having issues like the below all day:

Traceback (most recent call last):
  File "", line 4, in <module>
    import inspect
  File "C:\Python33\lib\", line 53, in <module>
    from dis import COMPILER_FLAG_NAMES as _flag_names
  File "C:\Python33\lib\", line 13, in <module>
    _have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
AttributeError: 'module' object has no attribute 'MethodType'


It seems to be a problem with the types module. All the types seem non-existing.
msg205825 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-12-10 15:19
I suspect you may have a file shadowing the standard library's; you can test with the following command:

python -c "import types;print(types.__file__)"

If the output from that is not "C:\Python33\lib\", then you have another file shadowing it, which would best be renamed.
msg205828 - (view) Author: Jimmy Merrild Krag (beruic) Date: 2013-12-10 15:25
Just figured that out my self. Holy mother of ¤%#&%/! I'm stupid!
msg205829 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-12-10 15:30
People are bitten by this kind of thing all the time, but usually only once ;)
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64146
2013-12-10 15:30:46zach.waresetresolution: rejected -> not a bug
messages: + msg205829
2013-12-10 15:25:41beruicsetstatus: pending -> closed
resolution: rejected
messages: + msg205828
2013-12-10 15:19:43zach.waresetstatus: open -> pending
nosy: + zach.ware
messages: + msg205825

2013-12-10 14:49:44beruiccreate