prophet
prophet copied to clipboard
Cannot run Prophet from the pyQGIS console
I am developping a QGIS plugin that uses the Prophet library. While my scripts run outside the QGIS environments, they don't work in the QGIS console.
Here are the steps to reproduce the issue:
Simple script calling Prophet:
from prophet import Prophet
import pandas as pd
df = pd.DataFrame({'ds': ['2024-01-28', '2024-01-29', '2024-01-30'], 'y': [3, 4, 7]})
model = Prophet()
model.fit(df)
Errors:
AttributeError: 'NoneType' object has no attribute 'write'
(...)
RuntimeError: Error during optimization! Command 'C:\Users\[me]\AppData\Roaming\python\Python312\site-packages\prophet\stan_model\prophet_model.bin random seed=40062 data file=C:\Users\[me]\AppData\Local\Temp\tmpvgt3h7aq\9btiqwne.json init=C:\Users\[me]\AppData\Local\Temp\tmpvgt3h7aq\s6atri3h.json output file=C:\Users\[me]\AppData\Local\Temp\tmpvgt3h7aq\prophet_model1w6jn7o2\prophet_model-20250128234237.csv method=optimize algorithm=newton iter=10000' failed:
OS:
Windows 11 ProQGIS version:3.34.12
Any help would be appreciated so we can combine the power of these two wonderful open source tools.