Closed d416 closed 2 years ago
Hello @d416,
Thank you for opening this issue. Very interesting find! :-)
From the link you posted I can see that math.gcd
is the way to go for >= python 3.5.
Hello @d416,
I fixed this error in e2e6537e7f9d3d33db8511d400fb284e345d7c13 and added python 3.9 to the testing in a27ec7775a961877dfb7aed7511383e4e4aa01b1. I just released the fix in v1.0.6.
Thank you for contributing to GFO :-)
Describe the bug
In Python 3.9, using gradient_free_optimizers returns ImportError: cannot import name 'gcd' from 'fractions'
Code to reproduce the behavior
https://github.com/SimonBlanke/Gradient-Free-Optimizers/blob/master/examples/convex_function.py
Error message from command line ImportError: cannot import name 'gcd' from 'fractions'
System information:
Additional context
It looks like fractions.gcd was deprecated in Python 3.9 and replaced with math.gcd https://stackoverflow.com/questions/66174862/import-error-cant-import-name-gcd-from-fractions/67540570#67540570