PyCall cells error with export github action
stefanbringuier opened this issue · comments
I'm having issues with this github action during export of the notebooks that use PyCall.jl. I have the following in my notebooks:
and the notebooks run fine locally. However, upon pushing and github action for exporting the pluto notebooks I get pyimport errors.
Here is an example error that uses ScikitLearn.jl1, It runs without issues on local Pluto session. PyCall related cells give:
Footnotes
-
ScikitLearn.jl
automatically usesConda.jl
to installscikit-learn
so I don't really even need theConda
andPyCall
cell. If I remove them still get same error. ↩
Hi! When a notebook works on your computer, but not on the static export, then this is a reproducibility problem: the notebook is not guaranteed to work on its own.
Julia code that uses PyCall.jl will take some extra work before it is reproducible, because it depends on a global installation of python + packages. You could extra commands to your https://github.com/JuliaPluto/static-export-template/blob/main/.github/workflows/ExportPluto.yaml file to install the python dependencies, but then other people might not be able to run your notebook.
Alternatively, take a look at https://github.com/cjdoris/PythonCall.jl, a new alternative to PyCall, which makes reproducibility much easier.
I'm going to close this, but feel free to continue posting if you have more questions, or if you found a solution.