JuliaPy / JuliaPy/PyCall.jl

ReadOnlyMemoryError() Windows Only

Offen
#880 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
1.5k
Forks
186
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Hi,

I'm trying to use Julia to interact with casadi via PyCall, as it seems to be the best way to use casadi, but I get a ReadOnlyMemoryError() when I try to create solvers. The test process below works fine on Linux but fails to on Windows.
```
using PyCall
c = pyimport("casadi")
x=c.SX.sym('x')
nlp = Dict('x' => x, 'f' => (x-1)^2)
solver = c.nlpsol('solver', 'ipopt', nlp) <- This line causes the error!
sol = solver(lbx=-10, ubx=10)
```
I get the error:
```
ERROR: ReadOnlyMemoryError()
Stacktrace:
[1] macro expansion at C:\Users\USER\.julia\packages\PyCall\tqyST\src\exception.jl:95 [inlined]
[2] #109 at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:43 [inlined]
[3] disable_sigint at .\c.jl:446 [inlined]
[4] __pycall! at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:42 [inlined]
[5] _pycall!(::PyObject, ::PyObject, ::Tuple{String,String,Dict{String,PyObject}}, ::Int64, ::Ptr{Nothing}) at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:29
[6] _pycall!(::PyObject, ::PyObject, ::Tuple{String,String,Dict{String,PyObject}}, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:11
[7] (::PyObject)(::String, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:86
[8] (::PyObject)(::String, ::Vararg{Any,N} where N) at C:\Users\USER\.julia\packages\PyCall\tqyST\src\pyfncall.jl:86
[9] top-level scope at REPL[5]:1
```

Thanks!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.