Last modified: Jun 16, 2026
Install NeuralProphet in Python
NeuralProphet is a powerful library for time series forecasting. It combines the simplicity of Prophet with the flexibility of neural networks. This guide shows you how to install NeuralProphet in Python step by step.
We cover multiple installation methods, common errors, and a quick test. You will have a working setup in minutes.
Prerequisites
Before installing NeuralProphet, ensure you have Python 3.7 or higher. Check your Python version with this command:
python --version
You also need pip (Python package installer) and optionally conda if you use Anaconda. Install pip if missing:
python -m ensurepip --upgrade
A virtual environment is recommended to avoid conflicts. Create one with:
python -m venv neuralprophet_env
source neuralprophet_env/bin/activate # On Windows: neuralprophet_env\Scripts\activate
Method 1: Install with pip
The simplest way is using pip. Run this command in your terminal:
pip install neuralprophet
This installs the latest stable version and all dependencies like PyTorch, pandas, and numpy. The process usually takes 1–3 minutes.
If you want the latest development version, install from GitHub:
pip install git+https://github.com/ourownstory/neural_prophet.git
This gives you the newest features but may have bugs. Use the stable version for production.
Method 2: Install with conda
If you use Anaconda or Miniconda, install NeuralProphet from conda-forge:
conda install -c conda-forge neuralprophet
This method handles dependencies better on Windows. It also avoids some PyTorch installation issues.
After installation, verify it works:
import neuralprophet
print(neuralprophet.__version__)
0.5.0 # Example output
Common Installation Errors and Fixes
You may encounter errors during installation. Here are the most frequent ones and how to solve them.
Error: PyTorch not found
NeuralProphet requires PyTorch. If pip fails, install PyTorch separately first. Visit pytorch.org to get the correct command for your system. For CPU-only:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
Then retry pip install neuralprophet.
Error: Microsoft Visual C++ 14.0 required
On Windows, you may need C++ build tools. Download and install Microsoft C++ Build Tools. Choose the "Desktop development with C++" workload.
Alternatively, use conda installation which avoids this issue.
Error: numpy version conflict
NeuralProphet may require a specific numpy version. Upgrade numpy first:
pip install --upgrade numpy
Then install NeuralProphet again.
Test Your Installation
Create a test script to confirm everything works. This example loads sample data and fits a simple model.
# test_neuralprophet.py
from neuralprophet import NeuralProphet
import pandas as pd
# Load sample data
data = pd.read_csv('https://raw.githubusercontent.com/ourownstory/neural_prophet/main/example_data/weather.csv')
data['ds'] = pd.to_datetime(data['ds'])
data['y'] = data['y']
# Create and fit model
model = NeuralProphet()
model.fit(data, freq='D', epochs=10)
# Make future predictions
future = model.make_future_dataframe(data, periods=30)
forecast = model.predict(future)
print(forecast[['ds', 'yhat1']].head())
Run the script:
python test_neuralprophet.py
Expected output shows a DataFrame with dates and forecasted values:
ds yhat1
0 2015-01-01 12.3456
1 2015-01-02 12.5678
2 2015-01-03 12.7890
3 2015-01-04 13.0123
4 2015-01-05 13.2345
If you see this, NeuralProphet is installed correctly.
Dependencies Overview
NeuralProphet relies on several key libraries. Understanding them helps with troubleshooting.
- PyTorch: The neural network backend for training models.
- pandas: Handles time series data in DataFrame format.
- numpy: Provides numerical operations.
- matplotlib: Used for plotting forecasts.
- scikit-learn: For data preprocessing and metrics.
All dependencies install automatically with pip install neuralprophet. If any fail, install them individually.
Using NeuralProphet in a Project
After installation, you can integrate NeuralProphet into your workflow. For example, forecasting sales data:
import pandas as pd
from neuralprophet import NeuralProphet
# Load your data
df = pd.read_csv('sales.csv')
df['ds'] = pd.to_datetime(df['date'])
df['y'] = df['sales']
# Initialize model with custom parameters
model = NeuralProphet(
growth='linear',
yearly_seasonality=True,
weekly_seasonality=True,
daily_seasonality=False,
epochs=50
)
# Fit the model
model.fit(df, freq='D')
# Forecast next 7 days
future = model.make_future_dataframe(df, periods=7)
forecast = model.predict(future)
# Plot results
model.plot(forecast)
This gives you a forecast plot and predictions. Adjust parameters like learning_rate or num_hidden_layers for better accuracy.
Updating NeuralProphet
To update to the latest version, run:
pip install --upgrade neuralprophet
Check the release notes for breaking changes. Always test your code after an update.
Conclusion
Installing NeuralProphet in Python is straightforward with pip or conda. We covered prerequisites, two installation methods, common errors with fixes, and a test script. You now have a working setup for time series forecasting.
Start with the sample data to explore NeuralProphet's features. Experiment with different model parameters to improve your forecasts. The library is actively maintained, so keep it updated for the best performance.