[PyCall] Pre-installing a python package required by a Julia package

pyimport_conda will solve the installation problem for users whose Python comes from Anaconda (either Conda.jl, which installs its own Julia-specific Python install, or a full Anaconda install). This will include most Mac and Windows users, since Conda is the default Python used by PyCall on those systems.

So, in your module (to be precompile-safe as explained in the PyCall README), you would define const ezodf = PyNULL() and then, in your __init__() function, do:

copy!(ezodf, pyimport_conda("ezodf", "ezodf", "openglider"))

since it seems that ezodf is only available from the openglider channel in anaconda. Unfortunately, it looks like they only have a Linux package, not MacOS or Windows. Maybe you can work with the openglider people to provide Mac and Windows packages?

In your package build script (in OdsIO/deps/build.jl), you can try to check for the availability of the Python packages you want and run pip or something, or suggest that the user run it. It is pretty hard to do this in a way that works on lots of platforms, though, because there are so many ways to install packages on different systems. See the BinDeps package, which lets you specify ways to install things in different package managers.

Welcome to the wonderful world of external dependencies, unfortunately. Anaconda makes things a lot easier for Python packages, but not when there is no conda package for something.