Skip to content

gcd in fractions removed from python 3.9 #7

@designbynumbers

Description

@designbynumbers

When running the examples in python 3.10, one gets:

from pyknotid.make import trefoil
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.10/site-packages/pyknotid/make/init.py", line 13, in
from pyknotid.make.torus import torus_knot, torus_link
File "/usr/local/lib/python3.10/site-packages/pyknotid/make/torus.py", line 14, in
from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/usr/local/Cellar/python@3.10/3.10.0_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/fractions.py)

it seems that the problem is that this function has been replaced by math.gcd in python 3.9 and up:

https://docs.python.org/3/library/fractions.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions