-
-
Notifications
You must be signed in to change notification settings - Fork 11
_pydstool_jl_hack - where is this? #13
Comments
I'm not sure how to fix this. It's pointing to the monkey patching here: https://github.com/JuliaDiffEq/PyDSTool.jl/blob/master/src/_pydstool_jl_hack.py . @tkf was the fix tagged? |
@ChrisRackauckas No release AFAICT: Actually this "should not" happen. But I realized that it can happen if pydstool or scipy is not installed. I wasn't handling such case properly in @jacobsca Maybe you are not using Conda.jl? What is the output of the following commands?: versioninfo()
using Pkg
Pkg.status()
using PyCall # if it errors, try Pkg.add("PyCall") first
@show PyCall.conda
@show PyCall.pyprogramname If using Pkg
ENV["CONDA_JL_VERSION"] = "2"
ENV["PYTHON"] = ""
Pkg.build("PyCall") # let PyCall.jl use Conda.jl
exit() to let Conda.jl download miniconda2 and then install pydstool in it. |
Sorry - most of this is in the "stupid category." I've had PyDSTool up and running - but under 2.7. I have moved most of my work to 3.6 but forgot to do this with PyDSTool. I installed it - the examples in Julia now work. :)
Its not for DifferentialEquations and not really about the functionality but there is a nit - and nits bother me. I cannot get Radau or Dopri to run - I cannot get the compilation to work. I get the following error - maybe you have seen this??
------------------
clasajacobson@clasajacobson-Oryx-Pro:~/Downloads/pydstool-master/examples$ python3 Dopri_backwards_test.py
…-----------------------------------------------------------Present limitation of Python: Cannot rebuild librarywithout exiting Python and deleting the shared library /home/clasajacobson/Downloads/pydstool-master/examples/_dop853_my_ode_vf.soby hand! If you made any changes to the system you shouldnot proceed with running the integrator until you quitand rebuild.-----------------------------------------------------------
Did not compile shared library.Error in importing compiled vector field and integrator.Did you compile the RHS C code?Traceback (most recent call last): File "dop853_temp/dop853_my_ode_vf.py", line 14, in swig_import_helper return importlib.import_module(mname) File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlockedModuleNotFoundError: No module named '_dop853_my_ode_vf'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "Dopri_backwards_test.py", line 23, in <module> trajf = ode.compute('testf') File "/usr/local/lib/python3.6/dist-packages/PyDSTool-0.90.2-py3.6.egg/PyDSTool/Generator/Dopri_ODEsystem.py", line 463, in compute extraSpace=self.algparams['extraspace'], File "/usr/local/lib/python3.6/dist-packages/PyDSTool-0.90.2-py3.6.egg/PyDSTool/Generator/Dopri_ODEsystem.py", line 45, in __init__ modname, *imp.find_module(modname, ["dop853_temp"])) File "/usr/lib/python3.6/imp.py", line 235, in load_module return load_source(name, filename, file) File "/usr/lib/python3.6/imp.py", line 172, in load_source module = _load(spec) File "<frozen importlib._bootstrap>", line 684, in _load File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "dop853_temp/dop853_my_ode_vf.py", line 17, in <module> _dop853_my_ode_vf = swig_import_helper() File "dop853_temp/dop853_my_ode_vf.py", line 16, in swig_import_helper return importlib.import_module('_dop853_my_ode_vf') File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlockedModuleNotFoundError: No module named '_dop853_my_ode_vf'clasajacobson@clasajacobson-Oryx-Pro:~/Downloads/pydstool-master/examples$
Clas A. Jacobson1010 Horizon WayCT 06084 860 783 0074 (home)
jacobsonclas@sbcglobal.net
On Thursday, November 1, 2018, 1:22:08 AM EDT, Christopher Rackauckas <notifications@github.com> wrote:
I'm not sure how to fix this. It's pointing to the monkey patching here: https://github.com/JuliaDiffEq/PyDSTool.jl/blob/master/src/_pydstool_jl_hack.py . @tkf was the fix tagged?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Radau and Dopri needs a special install for PyDSTool that we don't do by default. These need to be compiled separately and something. |
I think this is still unresolved. In my course at the moment we can't use PyDSTool because of both Python 2.x and Python 3.x being installed on the system. PyCall seems to be defaulting to Python 3.x and then using PyDSTool fails. And often but not always it asks for _pdstool_jl_hack to be installed. It isn't clear to me what we should do ... I am reluctant to play with ENV() because I worry it will contaminate other uses of PyCall. |
I think using Python 2 is the only option unless you want to use pydstool master. You need to use |
Hi, I am facing a similar problem. I can add and build the
Do you have any suggestions on how to get it working ? |
Thank you for your suggestion! I still have an issue on my side concerning the wrapper. I wrote a message on slack about it. Once, this is fixed, it is very easy for me to write a tutorial. As for |
That's correct (sadly...). Also, IIRC, PyDSTool (or more like AUTO) calculates the Jacobian for the bifurcation analysis/continuation of the limit cycle in a clever way (and uses its intermediate result for Floquet or something like that). What I implemented there was super dumb (just use ForwardDiff). |
Yes they use a periodic schur decomposition. Yesterday, I was trying
Do you mean that you have a way to get the Floquet coeffs? Even if not very accurate, you should add a quick and dirty solution, it can always be improved in the future. |
Yeah, that's true... The reason why I've been shy about this project was that I have hard time understanding some outputs. Maybe there are critical bugs somewhere or I just miss-set some algorithm parameters or my intuition is wrong... (In particular, tkf/Bifurcations.jl#8 was the one behaving strangely. Though I need to clean it up and explain the oddity before asking for a help.) Maybe I should just document everything and let people find the bugs for me 😛
I meant the computation of Jacobian is slow because I just simply hand it over to ForwardDiff. |
I'm trying to use PyDSTool in DifferentialEquations...but it won't load. I get this long red error message that says
ERROR: InitError: PyError (PyImport_ImportModule
The Python package _pydstool_jl_hack could not be found by pyimport. Usually this means
that you did not install _pydstool_jl_hack in the Python version being used by PyCall.
Any clues how to fix this?? I done some web crawling but cannot seemingly find a helpful answer...
The text was updated successfully, but these errors were encountered: