0

i am use microsoft azure (for students) ML servise. Then i work with notebook i can not import pytorch-lightning libary.

!pip install pytorch-lightning==0.9.0 
import pytorch_lightning as pl

Here i have error:

ModuleNotFoundError                       Traceback (most recent call last)
Input In [1], in <module>
----> 2 import pytorch_lightning as pl

ModuleNotFoundError: No module named 'pytorch_lightning'

This is unbearably weird. someone faced such a problem?

2 Answers2

1

This is rather strange but could be related to that your installation is in another location, so let's:

  1. try where is PL installed with find -name "lightning"
  2. also, check what is the loaded package locations python -c "import sys; print(sys.path)"

I guess that the problem will be in What's the difference between dist-packages and site-packages?

Jirka
  • 1,126
  • 6
  • 25
0

I resolved this problem by installing PyTorch-lightning in the kernel instead of the machine. It all boils down to installing with %conda magic instead of !conda magic (or same thing for %pip magic instead of !pip magic).

Malcolm
  • 662
  • 7
  • 29