-
Notifications
You must be signed in to change notification settings - Fork 12
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
Package doesn't work with even demo.jl #5
Comments
I installed the latest Julia 1.1.1 and just this package and dependencies. It doesn't work either (1.0.x only?). By default I get the expected: but even with older the older PyCall then ending with the same (and beginning there) with the same ERROR. |
The plot thickens. I tried installing Julia 1.0.4 to be sure, but now I get a segfault unlike for e.g. Julia 1.1: julia> using Py2Jl signal (11): Segmentation fault |
Don't know why either but the Segmentation fault cannot be my fault... I'll do a quick patch. |
What exact version should work (e.g. some 1.0.x prior to 1.0.4, or 1.1.y for some y, or did you use some 1.2 later?)? I got (v1.1) pkg> add https://github.com/JuliaCN/Py2Jl.jl#72aaa82D to get the same error in 1.0.4, but at least not a segfault. |
It should be 1.1.x, but I think it should be okay to work in 1.0.x. |
Sorry, I've just got passed the tests... What I've done is simply updating MLStyle.jl dependency.. |
Ok, so you always used 1.1, when I suppose it wan not yet released. This could be very helpful for me (for work on Polyglot.jl) discussed here: https://discourse.julialang.org/t/compatibility-across-julia-1-versions/27196/15# |
Some bugs in 1.0.x has been already resolved several months ago, but I don't sync this repo's dependencies. |
You mean you used 1.0.x then changed to 1.1.y, and assumed all 1.0.z versions would still work (as you should)? [I just need to know what commit of your code worked in some exact Julia version, e.g. some exact y (or x). Then I could try that combination of exact Julia version and older commit of your code. Or wait for you to fix, not pressuring to fix or answer soon, just curious to try your package.] |
No, this package is developed and tested in 1.1+, I've just tried v1.0, and got segmentation fault. |
The Py2Jl.jl for 1.1 has just got fixed. Are you still getting errors? |
Yes, still the same error in Julia 1.1.1. I tried to drop the packages and do e.g. (to see if matters):
|
Yes, I mean I'm getting an error for what you have in the test cases... Did it work for you?! Am I maybe doing something wrong, or do you not have something to run the test (automatically) prior to committing? |
Yes it does work for me... However I think it's not your fault. Did you update the dependency? Or is your PyCall version exact to my Project.toml? |
Did you try using package mode to test it directly? julia1.1+ > ]
julia1.1+ > activate .
julia1.1+ > test |
Hi, I found that although in Julia 1.0.4 running the test will raise segmentation faults, if I paste all codes into julia shell, I can run it correctly(with many warnings though). |
Yes, I get segfault for "using Py2Jl" on 1.0.4; and thus for "test Py2Cl" (which implies "using"; good to know about that command). On 1.1.1 however, no segfault, so since I've reported segfault (and you too for same?), will concentrate on 1.1.1 for the time being. Note, not just warnings, but an error at the end. You can disable all the warnings with pkg> add PyCall#v1.18.0 Since those are less important, for now, I would concentrate on the error first, then tag maybe when working, then fix warnings and tag when that works without then. |
Yes, in my local environment for this repo,
It seems a pretty simple dependency case, I don't know why you got the error:
|
My global status:
|
I've reproduced your result in my CentOS server: ERROR: LoadError: "class: Module, attributes: Symbol[:class, :body]." That's a good start. It's a bit late in my timezone and I'll make it tomorrow. |
I noticed that I was using julia 1.1.0-rc2.0 as my local distribution, you might check whether this package can work in 1.1.0. Current state:
|
I've figured out what the problem it exactly is now. A concerned issue could be found at thautwarm/MLStyle.jl#62. As a workaround, we can replace each string pattern with another one, for instance, https://github.com/JuliaCN/Py2Jl.jl/blob/master/src/ASTGen.jl#L197 changing |
@PallHaraldsson let z = Dict{Symbol, Any}(:class=>"Module"), Main855_1218 = z
function Main858_1221(Main856_1219::Dict)
Main857_1220 = (get)(Main856_1219, :class) do
nothing
end
@info :bug Main857_1220 typeof(Main857_1220) Main857_1220 === "Module"
if Main857_1220 === "Module"
1
else
nothing
end
end
function Main858_1221(Main856_1219)
nothing
end
Main854_1217 = Main858_1221(Main855_1218)
if Main854_1217 === nothing
throw("failed")
else
Main854_1217
end
end
┌ Info: bug
│ Main857_1220 = "Module"
│ typeof(Main857_1220) = String
└ Main857_1220 === "Module" = false
ERROR: "failed"
Stacktrace:
[1] top-level scope at REPL[60]:19 |
"I noticed that I was using julia 1.1.0-rc2.0 [works with]" "test pass" Are you sure? I've been testing, Julia 1.0.0, and some later versions. "test Py2Jl" strangely works in some versions, but when you actually go further then you get a segfault, with "using Py2Jl" (even though I would have thought it implied by test. [I also got further in using /usr/bin/python3 some of the time when testing. I was following your instructions to the letter, and assumed python 2. Do you know if it should [NOT] work?] |
Python 2 shouldn't work at all for it has different AST shapes against those of Python 3. Currently I just extract Julia ASTs from Python ASTs(exactly python 3.6). I can support Python3.5+ by compating them via https://github.com/thautwarm/moshmosh/blob/master/moshmosh/ast_compat.py |
I'm pretty sure it works in several sub-versions of v1.1.0. Will the segmentation fault occur in 1.1.x? I'll at once try "using Py2Jl" in my remote server, to check if any inconsistent behaviours. |
Note, even in Julia 1.0.x can use this package in a strange way, say, paste all codes of this package (without putting them into Modules but to the top level) to Julia shell will work. |
I've just fixed the unmatched problems in 1.1.0+, have a check? |
I'm pretty sure I had to only do (in other versions, at least rc2): (v1.1) pkg> add Py2Jl
i.e. not: (v1.1) pkg> add https://github.com/JuliaCN/Py2Jl.jl Your nr. 5 update fixes 1.1.0 (and I guess 1.1.1) so README could be modified. I had just tested it and said otherwise in Discourse, but before the "(v1.1) pkg> update". |
I'm looking into debugging this, I thought it might be the new improved PyCall not working with this package, but even forcing the rev. you used didn't work:
[I doubt it should matter, but maybe me using Julia Version 1.2.0-DEV.55 is the problem? At least Julia 1.1.1 (or 1.0.x) should work, see next comment.
Have not yet checked 1.0.x](v1.2) pkg> st
Status
~/.julia/environments/v1.2/Project.toml
[537997a7] AbstractPlotting v0.9.5
[6e4b80f9] BenchmarkTools v0.4.2
[a93c6f00] DataFrames v0.17.1
[864edb3b] DataStructures v0.15.0
[e9467ef8] GLMakie v0.0.4
[54eb57ff] InteractiveCodeSearch v0.3.0
[6042db11] JDBC v0.4.1
[682c06a0] JSON v0.21.0
[d8e11817] MLStyle v0.3.0
[ee78f7c6] Makie v0.9.1
[dbd62bd0] MakieGallery v0.0.4
[c020b1a1] NaturalSort v0.0.1+ #fix_for_1_0_0 (https://github.com/endrebak/NaturalSort.jl)
[9b87118b] PackageCompiler v0.6.3
[91a5bcdd] Plots v0.26.0
[e53ffe30] Py2Jl v0.1.0 #master (https://github.com/JuliaCN/Py2Jl.jl)
[438e738f] PyCall v1.91.2+ #1309efc (https://github.com/JuliaPy/PyCall.jl.git)
[d330b81b] PyPlot v2.7.0
[bf110322] Python v0.1.0 #master (https://github.com/229668880/Python.jl)
[1a8c2f83] Query v0.11.0
[e6cf234a] RandomNumbers v1.2.0
[f2b01f46] Roots v0.8.1
[3646fa90] ScikitLearn v0.5.0
[992d4aef] Showoff v0.2.1
[98e33af6] SimpleDirectMediaLayer v0.1.0
[276daf66] SpecialFunctions v0.7.2
[65254759] StatsMakie v0.0.2
[9a3f8284] Random
The text was updated successfully, but these errors were encountered: