Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fractions/GCD error with python3.9 #2

Open
jparsert opened this issue May 27, 2021 · 1 comment
Open

Fractions/GCD error with python3.9 #2

jparsert opened this issue May 27, 2021 · 1 comment
Assignees

Comments

@jparsert
Copy link

When running irankfinder.py
I get the exception:

....
from fractions import Fraction, gcd
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib/python3.9/fractions.py)

This might be an exception from https://github.com/jesusjda/pyLPi though.

@jesusjda
Copy link
Owner

jesusjda commented May 29, 2021

Thanks for opening the issue.

Your traceback says Python 3.9 and since this version the GCD function has been moved to the math package. I will try to adapt it to this new behaviour.

Changed in version 3.9: The math.gcd() function is now used to normalize the numerator and denominator. math.gcd() always return a int type. Previously, the GCD type depended on numerator and denominator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants