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

2020-07-18 Thread David Friedman


David Friedman  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-05-09 Thread Ezio Melotti

Ezio Melotti added the comment:

Closing for lack of feedback.
Feel free to re-open if/when more info are available.

--
nosy: +ezio.melotti
status: pending - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-04-16 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution:  - works for me
stage:  - committed/rejected
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-03-07 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-03-03 Thread bsduni

New submission from bsduni:

Hi!

I have installed Python 2.7.6 fully (all the modules selected). I attempted run 
some Python codes that were developed by a past staff, and am stuck with an 
issue with argparse. 

For ease of explanation I am using the example given in this website at 
http://docs.python.org/2/howto/argparse.html.

When I create a simple program prog.py with codes below:

import argparse
parser = argparse.ArgumentParser()
parser.parse_args()

and execute with $ python prog.py, the following is the error message I receive:
Traceback (most recent call last):
  File prog.py, line 2, in module
parser = argparse.ArgumentParser()
AttributeError: 'module' object has no attribute 'ArgumentParser'

I also tried to add argparse additionally using pip install and the problem 
remains the same.

Would be grateful if someone could help to overcome this AttributeError.

--
components: Extension Modules
messages: 212620
nosy: bsduni
priority: normal
severity: normal
status: open
title: AttributeError: 'module' object has no attribute 'ArgumentParser'
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-03-03 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

I guess that there is argparse module in current directory, which overrides 
argparse module from standard library.
Use e.g. print(argparse) or print(argparse.__file__) to find it.
A correct location would be something like /usr/lib64/python2.7/argparse.pyc.

--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-03-03 Thread bsduni

bsduni added the comment:

Unfortunately it is not that case, ie, no argparse in my current working 
directory /home/bsduni/pytests/ (on a FreeBSD 9.2 system).

The following are the locations I can find argparse in my system:

/usr/local/lib/python2.7/argparse.py
/usr/local/lib/python2.7/argparse.pyo
/usr/local/lib/python2.7/argparse.pyc

/usr/ports/lang/python27/work/Python-2.7.6/Doc/howto/argparse.rst
/usr/ports/lang/python27/work/Python-2.7.6/Doc/library/argparse.rst
/usr/ports/lang/python27/work/Python-2.7.6/Lib/argparse.py

/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.py
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.pyc
/usr/ports/lang/python27/work/stage/usr/local/lib/python2.7/argparse.pyo

/usr/local/lib/python2.7/site-packages/IPython/external/argparse

/usr/local/lib/python2.7/site-packages/argparse.py
/usr/local/lib/python2.7/site-packages/argparse.pyc
/usr/local/lib/python2.7/site-packages/argparse-1.1-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse
/usr/local/lib/python2.7/site-packages/argparse_actions
/usr/local/lib/python2.7/site-packages/argparse_actions-0.4.4-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse_config
/usr/local/lib/python2.7/site-packages/argparse_config-0.5.1-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse.extra-0.0.2-py2.7.egg-info
/usr/local/lib/python2.7/site-packages/argparse.extra-0.0.2-py2.7-nspkg.pth


The the files in /usr/local/lib/python2.7/site-packages/ are from the 'pip 
install' which I tried when argparse didnot work after the installation of 
Python in full (ie, with argparse files in /usr/local/lib/python2.7/)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2014-03-03 Thread R. David Murray

R. David Murray added the comment:

Please show the output from

   print(argparse.__file__)

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20840
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com