JuliaCN / Py2Jl

Python to Julia transpiler.
MIT License
74 stars 12 forks source link

ERROR: LoadError: UndefVarError: installed not defined #12

Open zsz00 opened 5 years ago

zsz00 commented 5 years ago

Julia Version 1.4.0-DEV.254 Commit 3b1c1fdde3 (2019-10-04 01:47 UTC) Platform Info: OS: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

using Py2Jl

ERROR: LoadError: LoadError: LoadError: UndefVarError: installed not defined Stacktrace: [1] getproperty(::Module, ::Symbol) at .\Base.jl:26 [2] top-level scope at C:\Users\zsz.julia\packages\Py2Jl\H6uW5\src\ASTGen.jl:13 [3] eval(::Module, ::Any) at .\boot.jl:330 ....

thautwarm commented 5 years ago

Sorry. You should ping me...

thautwarm commented 5 years ago

Did Pkg change it API in 1.4?

visr commented 4 years ago

Pkg.installed is deprecated in 1.4, yes.

I'm not sure I understand the compat_32842 code. Why do we check if MLStyle is installed if it is in the dependencies? Can't we just require a sufficiently new MLStyle version?

thautwarm commented 4 years ago

@visr You could just ask me the functionality because this is quite a tricky workaround.

It's exactly a workaround for https://github.com/JuliaLang/julia/issues/32842 .

To solve this, a quick fix is transforming all string literal pattern like "xxx" to pattern &"xxx", where the former is matched by === comparisons, and the latter is matched by == comparisons.

visr commented 4 years ago

I see. Would it be an option to stop supporting the julia versions where this is broken?

thautwarm commented 4 years ago

@visr I don't think it an appealing idea. We can make a tag for previously supported versions. And remove compat_32842 stuffs and poblish things since new Julia versions.

thautwarm commented 4 years ago

I'll do it later, but this is actually not in a high priority.

If you want I can give your help for trying maintaining it. We could talk in Slack(search thautwarm/Taine Zhao in Julia Slack), and I can answer you any trivial or non-trivial questions about this package.

visr commented 4 years ago

Thanks! This issue just gives a deprecation warning on julia 1.4-rc. It was submitted during 1.4-dev, probably before the deprecation was in place, giving a hard error.