Skip to content

Using juliapomdps and PyCall across python executables  #42

@markkho

Description

@markkho

except (ImportError, julia.core.UnsupportedPythonError):

juliapomdps relies on PyCall, which is installed in a way that links it to a particular python executable (e.g., in a virtual environment). If I try to run python -m msdm.tools.install_julia_pomdps and I already have PyCall set up (e.g., I set it up in a separate virtual environment), then it throws a julia.core.UnsupportedPythonError. The error message suggests two workarounds:

The easiest workaround is to pass `compiled_modules=False` to `Julia`
constructor.  To do so, first *reboot* your Python REPL (if this happened
inside an interactive session) and then evaluate:

    >>> from julia.api import Julia
    >>> jl = Julia(compiled_modules=False)

Another workaround is to run your Python script with `python-jl`
command bundled in PyJulia.  You can simply do:

    $ python-jl PATH/TO/YOUR/SCRIPT.py

See `python-jl --help` for more information.

For more information, see:

    https://pyjulia.readthedocs.io/en/latest/troubleshooting.html

PyCall has some workarounds as well (see discussion of virtual environments), but they all would require the user to interact with julia.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions