We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I have a problem with my package where I import the pillow module as the PIL variable in the package's init https://github.com/CarloLucibello/HuggingFaceDatasets.jl/blob/3362f5650483e6ace17e7f2d98af36252d9f4316/src/HuggingFaceDatasets.jl#L43
pillow
I run the package's tests
include("test/runtests.jl")
and I get the error
Python: AttributeError: module 'PIL' has no attribute 'PngImagePlugin' Python stacktrace: none Stacktrace: [1] pythrow() @ PythonCall ~/.julia/packages/PythonCall/dsECZ/src/err.jl:94 [2] errcheck @ ~/.julia/packages/PythonCall/dsECZ/src/err.jl:10 [inlined] [3] pygetattr(x::Py, k::String) @ PythonCall ~/.julia/packages/PythonCall/dsECZ/src/abstract/object.jl:60 [4] getproperty @ ~/.julia/packages/PythonCall/dsECZ/src/Py.jl:272 [inlined] [5] _pyconvert(x::Py) @ HuggingFaceDatasets ~/juliadev/HuggingFaceDatasets/src/transforms.jl:8 [6] py2jl(x::Py) @ HuggingFaceDatasets ~/juliadev/HuggingFaceDatasets/src/transforms.jl:33
The weird thing is that the module actually exists
julia> HuggingFaceDatasets.PIL.PngImagePlugin Python module: <module 'PIL.PngImagePlugin' from '/home/lucibello/juliadev/HuggingFaceDatasets/.CondaPkg/env/lib/python3.11/site-packages/PIL/PngImagePlugin.py'>
and that when I rum some of the tests individually the error disappears and after that also include("test/runtests.jl") works fine. Any clue?
The text was updated successfully, but these errors were encountered:
Presumably the code is trying to access PIL.PngImagePlugin before it has been imported. This sounds like a bug in your tests.
PIL.PngImagePlugin
It probably works after running some other tests because they probably do import that module, so it is available again later through attribute access.
Sorry, something went wrong.
having
PythonCall.pycopy!(PIL, pyimport("PIL")) pyimport("PIL.PngImagePlugin")
in the package __init__ solves the issue for me.
__init__
No branches or pull requests
Hi,
I have a problem with my package where I import the
pillow
module as the PIL variable in the package's inithttps://github.com/CarloLucibello/HuggingFaceDatasets.jl/blob/3362f5650483e6ace17e7f2d98af36252d9f4316/src/HuggingFaceDatasets.jl#L43
I run the package's tests
and I get the error
The weird thing is that the module actually exists
and that when I rum some of the tests individually the error disappears and after that also
include("test/runtests.jl")
works fine.Any clue?
The text was updated successfully, but these errors were encountered: