I run into problems when trying to run the example code from:
What I did:
import Pkg
ENV["PYTHON"]=""
Pkg.build("PyCall")
Restarted the Julia CLI, then:
import Pkg
Pkg.add("Conda")
using Conda
Conda.runconda(`update -y conda`)
Conda.add("pandas")
Conda.add("prophet")
and
julia> using Conda
julia> using PyCall
julia> pd = pyimport("pandas")
PyObject <module 'pandas' from '/home/ftournier/.julia/conda/3/x86_64/lib/python3.12/site-packages/pandas/__init__.py'>
julia> pro = pyimport("prophet")
Importing matplotlib failed. Plotting will not work.
Importing plotly failed. Interactive plots will not work.
PyObject <module 'prophet' from '/home/ftournier/.julia/conda/3/x86_64/lib/python3.12/site-packages/prophet/__init__.py'>
julia> m = pro.Prophet()
PyObject <prophet.forecaster.Prophet object at 0x7fd6beece6f0>
julia> df = pd.read_csv("https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv")
PyObject ds y
0 2007-12-10 9.590761
1 2007-12-11 8.519590
2 2007-12-12 8.183677
3 2007-12-13 8.072467
4 2007-12-14 7.893572
... ... ...
2900 2016-01-16 7.817223
2901 2016-01-17 9.273878
2902 2016-01-18 10.333775
2903 2016-01-19 9.125871
2904 2016-01-20 8.891374
[2905 rows x 2 columns]
Next step failed:
julia> m.fit(df)
14:55:24 - cmdstanpy - INFO - Chain [1] start processing
14:55:24 - cmdstanpy - INFO - Chain [1] done processing
14:55:24 - cmdstanpy - ERROR - Chain [1] error: error during processing Operation not permitted
Optimization terminated abnormally. Falling back to Newton.
14:55:24 - cmdstanpy - INFO - Chain [1] start processing
14:55:24 - cmdstanpy - INFO - Chain [1] done processing
14:55:24 - cmdstanpy - ERROR - Chain [1] error: error during processing Operation not permitted
ERROR: PyError ($(Expr(:escape, :(ccall(#= /home/jska/.julia/packages/PyCall/1gn3u/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw)))))
[15267] signal 11 (1): Segmentation fault
in expression starting at none:0
PyErr_CheckSignals at /usr/local/src/conda/python-3.12.11/Modules/signalmodule.c:1771 [inlined]
PyObject_Repr at /usr/local/src/conda/python-3.12.11/Objects/object.c:544
pystring at /home/jska/.julia/packages/PyCall/1gn3u/src/PyCall.jl:243
show at /home/jska/.julia/packages/PyCall/1gn3u/src/exception.jl:39
showerror at ./errorshow.jl:30 [inlined]
#showerror#1026 at ./errorshow.jl:97
showerror at ./errorshow.jl:95
unknown function (ip: 0x7f6b381018a2)
show_exception_stack at ./errorshow.jl:996
display_error at ./client.jl:117
jfptr_display_error_11782.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
jl_apply at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
jl_f__call_latest at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
repl_display_error at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:414
print_response at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:431
#70 at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:405
jfptr_YY.70_10215.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
with_repl_linfo at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:678
jfptr_with_repl_linfo_10303.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
print_response at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:403
do_respond at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1037
jfptr_do_respond_10366.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
jl_apply at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
jl_f__call_latest at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
#126 at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:1444
jl_apply at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
jl_f__call_latest at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
#30 at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:1711
jfptr_YY.30_8323.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
macro expansion at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2861 [inlined]
macro expansion at ./lock.jl:273 [inlined]
#282 at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2851
jfptr_YY.282_8870.1 at /opt/jska-tmp/julia-1.11.6/share/julia/compiled/v1.11/REPL/u0gqU_QBeOa.so (unknown line)
jl_apply at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
start_task at /cache/build/tester-amdci4-12/julialang/julia-release-1-dot-11/src/task.c:1202
Allocations: 1056136 (Pool: 1055206; Big: 930); GC: 2
Segmentation fault
Iβm not familiar with using Python under Julia so I may have done something wrong.
It looks like you are on a slightly outdated version of PythonCall, please update to the latest version (0.9.27) and try again, which should fix that CXX ABI error youβre getting.
Everything looks very unstable when I load PythonCall, even with 1 thread:
julia> using PythonCall
ERROR: InitError: Python: SystemError: initialization of _datetime did not return an extension module
Python stacktrace:
[1] <module>
@
SYSTEM (REPL): showing an error caused an error
ERROR: Python:
SYSTEM (REPL): caught exception of type PyException while trying to handle a nested exception; giving up
These segfaults and system errors are very strange. It seems like the python installation is corrupted or something.
Do you have any relevant environment variables set? Can you list any containing PYTHON or JULIA or LD_LIBRARY_PATH or anything else that looks potentially relevant?
julia> CondaPkg.withenv() do
run(`python`)
end
Python 3.12.11 | packaged by conda-forge | (main, Jun 4 2025, 14:45:31) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
A bit off-topic (since this isnβt PyCall-related), but hereβs an alternative way
to use Prophet from Julia if nothing else works.
Instead of embedding Python inside Julia via the Python C API (like PyCall or
PythonCall), Rembus.jl communicates with Python at the message-passing level (sockets).
That means you can run Prophet inside a pure Python server process, and call it
from Julia as a client β no shared runtimes, just RPC-style communication.
Python server (forecast-server.py)
import pandas as pd
from prophet import Prophet
import rembus
def forecast(file):
df = pd.read_csv(file)
m = Prophet()
m.fit(df)
future = m.make_future_dataframe(periods=365)
fcast = m.predict(future)
return fcast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']]
# Serve RPC requests on port 8000
rb = rembus.node(port=8000)
rb.expose(forecast)
rb.wait()