'minizinc python installation

I installed minizinc on python through anaconda prompt as normally with other packages.

pip install minizinc

The package says it was installed successfully and I can import the module. However, I'm following the basic example https://minizinc-python.readthedocs.io/en/latest/getting_started.html#a-basic-example but Once I run the first line

from minizinc import Instance, Model, Solver

and I'm getting the import error below:

    ImportError: cannot import name 'Instance' from 'minizinc' 
(C:\ProgramData\Anaconda3\lib\site-packages\minizinc\__init__.py)

This is the only package I have problems with. My current python version is 3.7 which according to https://minizinc-python.readthedocs.io/en/latest/getting_started.html#a-basic-example should support minizinc. If anyone has faced the same issue and fixed the problem I'll appreciate any feedback regarding this problem.



Solution 1:[1]

The MiniZinc bundle (or at least the minizinc executable) should be installed in order to use MiniZinc Python. It is noted as one of the required dependencies in the installation documentation.

When the minizinc executable is not found, MiniZinc Python will output the following warning to indicate that the executable could not be located:

MiniZinc was not found on the system: no default driver could be initialised

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dekker1