I'm following this tutorial trying to implement argparse
into a python
script I'm writing.
When I run this snippet of code from the tutorial I receive the following error:
[05:51 PM] user Scripts> cat argparse.py
import argparse
parser = argparse.ArgumentParser()
parser.parse_args()
[05:51 PM] user Scripts> python3 argparse.py
Traceback (most recent call last):
File "argparse.py", line 1, in <module>
import argparse
File "/home/brian/Documents/Scripts/argparse.py", line 2, in <module>
parser = argparse.ArgumentParser()
AttributeError: 'module' object has no attribute 'ArgumentParser'
I'm running Python 3.3.2
and have installed argparse 1.2.1
using easy_install
so I know it's on the system but I cannot determine what is causing the error.
Note: I've read this post and it is not related.