I have the following code intended to access sympy’s logic functionality (not implemented in SymPy.jl)
using PyCall
pyimport_conda("sympy.logic", "sympy")
py"""
from sympy.logic import POSform
from sympy import symbols
def kmap_py(symstr, minterms):
syms = symbols(symstr)
return POSform(syms, minterms)
which I use like
julia> py"kmap_py"("b1 b2", PyVector([0,1,3]))
This works fine on one PC (running Windows 10) and gives the error below on another (Win 7). Both PCs have the same directory structure, and both are using the built in conda version (ENV["PYTHON"] == ""
). Any idea what the difference could be? Here is the error
ERROR: PyError ($(Expr(:escape, :(ccall(#= C:\julia-depot\packages\PyCall\ttONZ\src\pyfncall.jl:44 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <c
lass 'TypeError'>
TypeError("'int' object is not iterable",)
File "C:\julia-depot\packages\PyCall\ttONZ\src\pyeval.jl", line 6, in kmap_py
File "C:\julia-depot\conda\3\lib\site-packages\sympy\logic\boolalg.py", line 1898, in POSform
minterms = [list(i) for i in minterms]
File "C:\julia-depot\conda\3\lib\site-packages\sympy\logic\boolalg.py", line 1898, in <listcomp>
minterms = [list(i) for i in minterms]