Skip to content

Imported juliacall.newmodule() namespace not updated #92

Closed
@charstnut

Description

@charstnut

It seems that in python, using command juliacall.newmodule() does not update the python namespace after importing a new module in julia.

MWE:

>>> import juliacall; pkg = juliacall.newmodule("Pkg")
Querying Julia versions from https://julialang-s3.julialang.org/bin/versions.json
Found Julia 1.7.1 at 'julia'
>>> pkg.status()  #Pkg.status() should work
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/char/repo/PythonCall.jl/src/jlwrap/any.jl:167", line 18, in __getattr__
AttributeError: Julia: UndefVarError: status not defined
>>> pkg
<jl Main.Pkg>
>>>

Proposed temporary workaround is to just use Main.seval() for now, but as noted in documentation it would be great to have the ability to call functions directly from imported julia modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions