# Julia could not load dynamic library error when called from Python

**URL:** <https://discourse.julialang.org/t/julia-could-not-load-dynamic-library-error-when-called-from-python/64714>\
**Category:** General Usage\
**Tags:** python, pythoncall\
**Created:** [July 15, 2021, 8:08pm UTC](https://discourse.julialang.org/t/julia-could-not-load-dynamic-library-error-when-called-from-python/64714 "2021-07-15T20:08:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arrigo\_Benedetti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arrigo_benedetti/32/25545_2.png) [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Post date:** [July 15, 2021, 8:08pm UTC](https://discourse.julialang.org/t/julia-could-not-load-dynamic-library-error-when-called-from-python/64714/1 "2021-07-15T20:08:09Z")

</div>

I have some Python code calling a Julia function via `PythonCall.jl`. The Julia function is defined in a module that uses several Julia packages and `Pango.jl` is a dependency. The line

```julia
import rasterio

```

in the Python code trigger this error:

```julia
vagrant@vagrant:/vagrant$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/vagrant/julia-1.6.1/lib/julia" python3 run_test.py 
Traceback (most recent call last):
  File "run_test.py", line 13, in <module>
    import module_mi as mi
  File "/vagrant/module_mi.py", line 17, in <module>
    jl.seval("using MutualInformation")
juliacall.Error: InitError: could not load library "/home/vagrant/.julia/artifacts/783bdcb1f64473a5b79a2bca8920a3a271c4d81a/lib/libpangocairo-1.0.so"
/home/vagrant/.julia/artifacts/783bdcb1f64473a5b79a2bca8920a3a271c4d81a/lib/libpangoft2-1.0.so.0: undefined symbol: FcWeightFromOpenTypeDouble
during initialization of module Pango_jll

```

Notice that I need to prepend `LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/vagrant/julia-1.6.1/lib/Julia"` to the `python3` invocation so that Julia fill find the DLLs it needs. When I do not `import rasterio` there is no error. There is clearly some interaction between `rasterio` and Julia. Any ideas about how to debug this?
