Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when importing de #135

Open
natasa-pavlov opened this issue Feb 1, 2024 · 4 comments
Open

Error when importing de #135

natasa-pavlov opened this issue Feb 1, 2024 · 4 comments
Labels
question Further information is requested

Comments

@natasa-pavlov
Copy link

Question❓

I'm having issues when I run the line from diffeqpy import de in Python 3.9.6 and with Julia 1.8.3. installed.

I get the following error:

>>> from diffeqpy import de
  Activating project at `~/.julia/environments/diffeqpy`
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/natasa/Library/Python/3.9/lib/python/site-packages/diffeqpy/de.py", line 5, in <module>
    de.jit = Main.seval("jit(x) = typeof(x).name.wrapper(ModelingToolkit.modelingtoolkitize(x), x.u0, x.tspan, x.p)") # kinda hackey
  File "/Users/natasa/.julia/packages/PythonCall/wXfah/src/jlwrap/any.jl", line 204, in __setattr__
    self._jl_callmethod($(pyjl_methodnum(pyjlany_setattr)), k, v)
AttributeError: Julia: cannot assign variables in other modules

Any feedback will be much appreciated!

@natasa-pavlov natasa-pavlov added the question Further information is requested label Feb 1, 2024
@ChrisRackauckas
Copy link
Member

Are you sure you're on the latest versions of the packages?

@HuynhTran0301
Copy link

I have the same problem. I use Python 3.9.13, but I have several versions of Julia, ranging from 1.8.x to 1.10.x. I have installed the latest version of diffeqpy. When I implemented the ode it did not have the issue. How could I fix it?

@ChrisRackauckas
Copy link
Member

@LilithHafner can you look into this?

@LilithHafner
Copy link
Member

I'm having trouble reproducing this issue. I've tried on MacOS 13.6.3 on apple silicon with Julia 1.10.3 and python 3.9.13, using diffeqpy version 2.4.1 and juliacall version 0.9.20. (I've also tried on Asahi linux with a variety over versions).

Would either of you be willing to report more detailed reproduction instructions?

Some useful things to know would be

  • What python package manager you're using
  • The versions of all installed python packages (e.g. pip freeze)
  • The versions in the Julia project @diffeqpy (launch Julia, press ] to enter the Pkg prompt, enter activate @diffeqpy, enter st)
(@v1.10) pkg> activate @diffeqpy
  Activating project at `~/.julia/environments/diffeqpy`

(@diffeqpy) pkg> st
Status `~/.julia/environments/diffeqpy/Project.toml`
  [0c46a032] DifferentialEquations v7.13.0
  [961ee093] ModelingToolkit v9.15.0
  [6099a3de] PythonCall v0.9.20

I'll try to debug and fix this without reproducing it, but it would be much more effective if I can get the error to appear locally. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants