Я пытаюсь позвонить MiniZin c через python при использовании собственного интерфейса python.
Интерфейс работает под Ubuntu , но не в Win10 .
Я использую следующий код, который можно найти на официальном сайте MiniZin c A Basi c Пример
Я создал файл nqueens.mzn и добавил его в каталог проекта.
Я получаю следующую ошибку:
Traceback (most recent call last):
File "C:/Users/Sallo/PycharmProjects/MiniZincTest/main.py", line 11, in <module>
result = instance.solve()
File "C:\Users\Sallo\Python\Python37\lib\site-packages\minizinc\instance.py", line 99, in solve
return asyncio.run(coroutine)
File "C:\Users\Sallo\Python\Python37\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "C:\Users\Sallo\Python\Python37\lib\asyncio\base_events.py", line 579, in run_until_complete
return future.result()
File "C:\Users\Sallo\Python\Python37\lib\site-packages\minizinc\CLI\instance.py", line 394, in solve_async
**kwargs,
File "C:\Users\Sallo\Python\Python37\lib\site-packages\minizinc\CLI\instance.py", line 310, in solutions
proc = await self._driver.create_process(cmd, solver=self._solver)
File "C:\Users\Sallo\Python\Python37\lib\site-packages\minizinc\CLI\driver.py", line 170, in create_process
stderr=asyncio.subprocess.PIPE,
File "C:\Users\Sallo\Python\Python37\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "C:\Users\Sallo\Python\Python37\lib\asyncio\base_events.py", line 1529, in subprocess_exec
bufsize, **kwargs)
File "C:\Users\Sallo\Python\Python37\lib\asyncio\base_events.py", line 458, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
Вот код:
from minizinc import Instance, Model, Solver
# Load n-Queens model from file
nqueens = Model("./nqueens.mzn")
# Find the MiniZinc solver configuration for Gecode
gecode = Solver.lookup("gecode")
# Create an Instance of the n-Queens model for Gecode
instance = Instance(gecode, nqueens)
# Assign 4 to n
instance["n"] = 4
result = instance.solve()
# Output the array q
print(result["q"])