Help understanding PyCall-related Travis failure

I made a fairly trivial commit in SGP4.jl (removing __precompile__(), but now the CI is failing – apparently PyCall can’t find the sgp4 python module, although it appears that the SGP4.jl build process installs it properly. I’m not sure what could be going on here… any ideas?

It looks like Python executable is downgraded during pyimport_conda and after loading PyCall. It means that PyCall uses Python 3.7 (still exists in memory) while the conda environment is wiped out and Python 3.6 is installed. Maybe pinning Python version would help although it looks like there is no Conda.jl API nor conda CLI… (but there is a github comment saying that conda has an undocumented CLI…)

An easier solution would be to install it in deps/build.jl.

Thank you for your help. I think I understand what the problem is (although I don’t understand why it’s happening). I don’t think there is a way to pin Python while using pyimport_conda.

RE: using deps/build.jl, do you know of an example I could follow? I’m not sure how I’d do that.

Actually, pinning Python version was a bad idea since it makes impossible to install spg4. conda was forced to downgrade Python since there is no spg4 package for 3.7.

IJulia.jl installs jupyter during the build. But IJulia.jl does many other things so maybe it’s hard to see what’s going on:

Something like this may work (untested):

using PyCall
using Conda

if PyCall.conda
    Conda.add_channel("conda-forge")
    Conda.add("sgp4")
end

But I just noticed it has a problem too. You have to re-build PyCall after running Conda.add("sgp4") since PyCall has to be re-configured when Python interpreter is changed. Putting something like julia -e 'using Pkg; Pkg.clone(pwd()); try Pkg.build("SGP4"); catch; Pkg.build("SGP4"); end; Pkg.test("SGP4"; coverage=true)' in .travis.yml may work.

Thanks again. It seems to me that force-rebuilding PyCall upon building SGP4.jl is not a great way to handle installation in general, thought it might work for Travis.

Maybe it makes the most sense to focus on fixing this – to start, how can you even tell this is the case?

I think it’s a general problem in Conda.jl. It’s not great that anyone can have issues like this every time Python has an update.

I think you can post an issue here GitHub - conda-forge/sgp4-feedstock: A conda-smithy repository for sgp4.

1 Like