[issue20840] AttributeError: 'module' object has no attribute 'ArgumentParser'

David Friedman report at bugs.python.org
Sat Jul 18 15:22:58 EDT 2020


David Friedman <davidgfriedman at gmail.com> added the comment:

I know this is 6 years too late, but I had this problem a few minutes ago on Python2.7.  Googling didn't find me anything relevant except this bug entry.  However, I found the cause myself: I had a test file named argparse.py (and an argparse.pyc) in the current directory (i.e. $PYTHONPATH) which was overriding the one in the main python library path. Once I renamed my argparse.py and argparse.pyc to something else, python found the real argparse and that message (the same one you saw) disappeared.

----------
nosy: +David Friedman

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20840>
_______________________________________


More information about the Python-bugs-list mailing list