-
Notifications
You must be signed in to change notification settings - Fork 102
Description
I've been trying to conda package a python software I wrote that's dependent on pyjulia and I've been trying to write a conda recipe for pyjulia. This comes with the problem that the python interpreter is statically linked to libpython. However, I'm trying to configure it so that my users don't have to deal with the troubleshooting methods (and that the load times aren't as painful as with the compiled_modules fix). Ideally this would require no non-automatic configuring or installing by the user and would work on scripts, python prompts and in jupyter notebooks.
It's worth noting that I've been unsuccessful installing any non-core julia packages and having them transfer properly within conda (I can't seem to run julia.install() in the recipe and have it not need run again after installing it).
I've tried a number of things:
-
Link python to python-jl
I've changed python-jl to be run directly by python3 and then link python to python-jl. The conda recipe didn't seem to accommodate this and I had to ask users to do the linking manually. This works for prompts and scripts but seems to prevent users from launching jupyter notebooks at all, which is probably indicative of bigger problems. -
run a file similar to python-jl as a PYTHONSTARTUP file. This can be done automatically, but it doesn't work for scripts because it only comes into play in interactive mode.
-
run a file similar to python-jl as a part of sitecustomize.py. This seemed like it should work, but I get a strange error doing it. After it starts installing PyCall I get an error that it can't find Pkg in pyjulia's install script:
[ Info: Build log in /opt/anaconda3/envs/pyjtest/share/julia/site/packages/PyCall/zqDXB/src/../deps/build.log
ERROR: LoadError: ArgumentError: Package Pkg not found in current path:
- Run `import Pkg; Pkg.add("Pkg")` to install the Pkg package.
Stacktrace:
[1] require(::Module, ::Symbol) at ./loading.jl:892
[2] include(::Module, ::String) at ./Base.jl:377
[3] exec_options(::Base.JLOptions) at ./client.jl:288
[4] _start() at ./client.jl:484
in expression starting at /Users/mattjohnson/.local/lib/python3.7/site-packages/julia/install.jl:12
Error in sitecustomize; set PYTHONVERBOSE for traceback:
PyCallInstallError: Installing PyCall failed.
** Important information from Julia may be printed before Python's Traceback **
Is there a better way to do this?