SciML / diffeqpy

Solving differential equations in Python using DifferentialEquations.jl and the SciML Scientific Machine Learning organization
MIT License
531 stars 39 forks source link

Using diffeqpy on Google Colab #68

Closed m4hdiattar closed 11 months ago

m4hdiattar commented 4 years ago

I have problem importing this package in google Colab. is there any way you would suggest help me with that? when I try out " from diffeqpy import de" I receive this error:

`--------------------------------------------------------------------------- UnsupportedPythonError Traceback (most recent call last)

in () ----> 1 from diffeqpy import de 8 frames /usr/local/lib/python3.6/dist-packages/julia/core.py in __init__(self, init_julia, jl_init_path, runtime, jl_runtime_path, debug, **julia_options) 481 logger.debug("compiled_modules = %r", options.compiled_modules) 482 if not (options.compiled_modules == "no" or is_compatible_python): --> 483 raise UnsupportedPythonError(jlinfo) 484 485 self.api.init_julia(options) UnsupportedPythonError: It seems your Julia and PyJulia setup are not supported. Julia executable: julia Python interpreter and libpython used by PyCall.jl: /usr/bin/python3 /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 Python interpreter used to import PyJulia and its libpython. /usr/bin/python3 /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 Your Python interpreter "/usr/bin/python3" is statically linked to libpython. Currently, PyJulia does not fully support such Python interpreter. 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`
userrand commented 1 year ago

I have the same issue

[EDIT: there is another issue in this repository ( https://github.com/SciML/diffeqpy/issues/38#issuecomment-512609681 ) that solves this using :

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

The solution is mentioned in that issue and also in the following link given in that issue https://pyjulia.readthedocs.io/en/latest/troubleshooting.html ]

ChrisRackauckas commented 1 year ago

Has this been reported to the pyjulia repo? This sounds like a pyjulia issue.

ChrisRackauckas commented 11 months ago

With the v2.0 this is fixed. See https://colab.research.google.com/drive/1SQCu1puMQO01i3oMg0TXfa1uf7BqgsEW?usp=sharing