Closed
Description
It looks like this syntax is no longer working on Julia 1.11:
from juliacall import Main as jl
jl.x = 1
On 1.10 of Julia this works, but on 1.11, this raises the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
import juliapkg as jp; jp.require_julia("~1.11"); from juliacall import Main as jl; jl.x = 1
^^^^
File "/Users/mcranmer/PermaDocuments/PythonCall.jl/src/JlWrap/any.jl", line 254, in __setattr__
self._jl_callmethod($(pyjl_methodnum(pyjlany_setattr)), k, v)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Julia: Global Main.x does not exist and cannot be assigned. Declare it using `global` before attempting assignment.
I also verified this error did not depend on Python (3.10 through 3.13 all give the same error).
To quickly verify this:
# 1.10
python -c 'import juliapkg as jp; jp.require_julia("~1.10"); from juliacall import Main as jl; jl.x = 1'
# (Exits fine)
# 1.11
python -c 'import juliapkg as jp; jp.require_julia("~1.11"); from juliacall import Main as jl; jl.x = 1'
# Throws an error
cc @cjdoris