Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'lightning' #170

Open
binaryiiin opened this issue Jul 1, 2024 · 2 comments
Open

ModuleNotFoundError: No module named 'lightning' #170

binaryiiin opened this issue Jul 1, 2024 · 2 comments

Comments

@binaryiiin
Copy link

Hello,when i am running the code
from pts.model.tempflow import TempFlowEstimator from pts.model.time_grad import TimeGradEstimator from pts.model.transformer_tempflow import TransformerTempFlowEstimator

I meet the error below

`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[3], line 1
----> 1 from pts.model.tempflow import TempFlowEstimator
2 from pts.model.time_grad import TimeGradEstimator
3 from pts.model.transformer_tempflow import TransformerTempFlowEstimator

File D:\anaconda3\Lib\site-packages\pts\model_init_.py:2
1 from .utils import get_module_forward_input_names, weighted_average
----> 2 from .estimator import PyTorchEstimator

File D:\anaconda3\Lib\site-packages\pts\model\estimator.py:15
13 from gluonts.dataset.common import Dataset
14 from gluonts.model.estimator import Estimator
---> 15 from gluonts.torch.model.predictor import PyTorchPredictor
16 from gluonts.transform import SelectFields, Transformation
17 from gluonts.itertools import maybe_len

File D:\anaconda3\Lib\site-packages\gluonts\torch_init_.py:28
14 all = [
15 "PyTorchLightningEstimator",
16 "PyTorchPredictor",
(...)
25 "LagTSTEstimator",
26 ]
27 import torch
---> 28 from .model.estimator import PyTorchLightningEstimator
29 from .model.predictor import PyTorchPredictor
30 from .model.deep_npts import DeepNPTSEstimator

File D:\anaconda3\Lib\site-packages\gluonts\torch\model\estimator.py:18
15 import logging
17 import numpy as np
---> 18 import lightning.pytorch as pl
19 import torch.nn as nn
21 from gluonts.core.component import validated

ModuleNotFoundError: No module named 'lightning'`

@dracpet
Copy link

dracpet commented Jul 1, 2024

I get the same error when running the imports in the Quick Start example. Recently installed package and installation went without errors.
Installed in a Conda environment.

@gradyking
Copy link

gradyking commented Oct 6, 2024

+1 to both of you, I tried installing with pip install pytorchts, and simply running from pts.model.tempflow import TempFlowEstimator gives this error.

They haven't updated the requirements list since April 2022, so I looked at PyPI and found which versions of the libraries you need for each to emulate that working version:
Python 3.10
torch==1.11.0 gluonts==0.9.3 holidays==0.13 numpy==1.22.2 pandas==1.4.2 scipy==1.8.0 tqdm==4.64.0 matplotlib==3.5.1 tensorboard==2.8.0

After installing Python 3.10, then the libraries with pip install pytorchts torch==1.11.0 gluonts==0.9.3 holidays==0.13 numpy==1.22.2 pandas==1.4.2 scipy==1.8.0 tqdm==4.64.0 matplotlib==3.5.1 tensorboard==2.8.0, I was able to make the above import work, at least. I think gluonts added the lightning requirement sometime after April 2022 and this repo hasn't been updated yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants