1

I am using python 3.7, from an anaconda distribution.

I am having problems calling some functions from julia using pyjulia.

below is a snipped of my code:

import julia
from julia import Julia
julia.Julia(runtime=r"C:\Users\Bruno\AppData\Local\Programs\Julia\Julia-1.4.2\bin\julia.exe")
from julia import SpecialFunctions

SpecialFunctions.polygamma(3,2)

the package SpecialFunctons introduces generalized polygamma functions that can work with complex arguments (as opposed to the polygamma from Scipy, which only acceps real arguments).

The issue is that, when I run the polygamma function, i run into the following error:

julia exception: could not load library "libopenlibm"
The specified module could not be found.
 Stacktrace:
 [1] gamma at C:\Users\Bruno\.julia\packages\SpecialFunctions\LC8dm\src\gamma.jl:573 [inlined]
 [2] polygamma(::Int64, ::Float64) at C:\Users\Bruno\.julia\packages\SpecialFunctions\LC8dm\src\gamma.jl:359
 [3] polygamma(::Int64, ::Int64) at C:\Users\Bruno\.julia\packages\SpecialFunctions\LC8dm\src\gamma.jl:566
 [4] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at .\essentials.jl:712
 [5] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at .\essentials.jl:711
 [6] _pyjlwrap_call(::Function, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at C:\Users\Bruno\.julia\packages\PyCall\zqDXB\src\callback.jl:28
 [7] pyjlwrap_call(::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}, ::Ptr{PyCall.PyObject_struct}) at C:\Users\Bruno\.julia\packages\PyCall\zqDXB\src\callback.jl:49

Which means that python cannot find the libopenlibm library from julia, which is probably necessary to run the function SpecialFunctions.polygamma. I cannot figure out how to make python see this module. The dll libopenlibm.dll.a is clearly in the folder where julia is installed. I tried reinstalling pyjulia, modifying the PATH, and calling other modules of julia (to see if this would actualize a table perhaps). However, I had no success.

Other functions that do not require this library (for example, SpecialFunctions.gamma(x)) do not have this issue.

So, the question is probably: how can I make so that python loads this particular julia library into memory?

any help would be appreciated.

  • Does it work if you run `SpecialFunctions.polygamma(3,2)` directly from the Julia REPL? If it does, I would suggest opening an issue on [the GitHub repo](https://github.com/JuliaPy/pyjulia/issues). – Simeon Schaub Jun 18 '20 at 09:12

0 Answers0