-
Notifications
You must be signed in to change notification settings - Fork 101
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
OSError: access violation when calling Julia code in Dash app #507
Comments
Can you provide a minimum working example? |
I am having the exact same issue. JuliaCall has a similar issue |
I need specific steps to reproduce, please. |
sure! Here is a minimum example (modified from here)
When you interact with the callback you should see : the |
Is it possible that Dash may be using multiple threads here? Is Julia eval bring called on a separate thread than the one where Julia was initialized during the callback? |
I also suspected this may be the case, however it seems to me that the default configuration of Dash (as shown in the above example) should only use a single thread |
I know this is not a great workaround, but have you considered using Could you also detail environment system and report your operating system? Did you use pip or conda to set this up? |
Hey, not sure how useful this is for your case but the solution I went with in the end was simply to use HTTP.jl to set up a simple server, and just passed necessary data to and from the Dash app via HTTP requests. I found Dash.jl to be significantly underdeveloped for my requirements. |
I am on windows using julia 1.8.5 and python 3.11 (also tried 3.10). I used pip to configure my environment Like crabbixOCE, i also found Dash.jl to be too underderveloped for me |
Cool! I think that sounds like a decent for now solution. How do you do type conversions? Could you possibly provide a small example? |
Sure, I would send a json object from the python side, like
And then use the JSON3 package to parse it on the julia side:
Don't ask me why the JSON3.read is double-nested, that's just the way it seems to work lmao. For more complicated structures this might fail; in this case consider using a database or csv files as an intermediate. Hope this helps! |
Has anyone tried the MWE again with Julia v1.9? The new language feature allowing the number of threads to change during execution may help this work. Using |
Trying to call any julia code from inside a Dash app results in
OSError: exception: access violation reading 0x0000000000000018
.This error occurs no matter what code I try to call, even things like
Julia().eval("2+2")
so I know it's not a result of Julia errors.
My current workaround is running a second Quart app and sending POST requests to trigger asynchronous callbacks containing my Julia functions, which for some reason actually allow me to run my julia code. It seems ridiculous that I can't simply run my Julia code inside the dash app and if there's a known fix to this I'd very much like to hear it.
The text was updated successfully, but these errors were encountered: