Closed oucler closed 4 years ago
Which version of sympy are you using?
I had the same error, and I resolved it by going to mathematics_dataset/sample/polynomials.py and replacing from sympy.solvers.diophantine import base_solution_linear as diophantine_solve_linear_2d
with from sympy.solvers.diophantine.diophantine import base_solution_linear as diophantine_solve_linear_2d
on line 33.
sympy
I am using sympy: 1.6 .
from sympy.solvers.diophantine.diophantine import base_solution_linear as diophantine_solve_linear_2d
Thanks a lot, @minimario. It did the trick.
After cloning the repository I tried to run "python generate_to_file.py" but it generates an error:
Traceback (most recent call last): File "generate_file.py", line 39, in
from mathematics_dataset import generate
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/generate.py", line 29, in
from mathematics_dataset.modules import modules
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/modules/modules.py", line 21, in
from mathematics_dataset.modules import algebra
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/modules/algebra.py", line 25, in
from mathematics_dataset import example
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/example.py", line 23, in
from mathematics_dataset.util import composition
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/util/composition.py", line 28, in
from mathematics_dataset.sample import polynomials
File "/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/mathematics_dataset/sample/polynomials.py", line 33, in
from sympy.solvers.diophantine import base_solution_linear as diophantine_solve_linear_2d
ImportError: cannot import name 'base_solution_linear' from 'sympy.solvers.diophantine' (/home/ucleraiserver/.conda/envs/torch/lib/python3.7/site-packages/sympy/solvers/diophantine/init.py)
Do you know how to resolve it?