Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

run capital-gains command and get erro: AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'

Tags:

python

I'm trying to use python library capital-gains I refer https://pypi.org/project/capital-gains/ this python docs. when I run capital-gains command it throws an error:

AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'

Traceback (most recent call last): File "/home/archana/mantralabs/backend/env/bin/capital-gains", line 8, in sys.exit(main()) File "/home/archana/mantralabs/backend/env/lib/python3.6/site-packages/capital_gains/capital_gains.py", line 11, in main parser = argument_parser.get_parser() File "/home/archana/mantralabs/backend/env/lib/python3.6/site-packages/capital_gains/argument_parser.py", line 52, in get_parser action=argparse.BooleanOptionalAction, AttributeError: module 'argparse' has no attribute 'BooleanOptionalAction'

Python version - 3.8

Can anyone help me? i'm not able to find out solution on google

like image 667
Priyu Sonar Avatar asked Oct 15 '25 15:10

Priyu Sonar


1 Answers

Actually The argparse.BooleanOptionalAction feature is only available in Python 3.9 and above. you can try with python 3.9 or above version's

like image 164
user18161535 Avatar answered Oct 17 '25 04:10

user18161535



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!