We Are Going To Discuss About Unable to import pytorch_lightning on google colab. So lets Start this Python Article.
Unable to import pytorch_lightning on google colab
- How to solve Unable to import pytorch_lightning on google colab
As said in Issue #6415 on Github, try installing from the GitHub.
It worked for me.!pip install git+https://github.com/PyTorchLightning/pytorch-lightning import pytorch_lightning as pl print(pl.__version__)
Output:1.3.0dev
It seems that the error is coming from Issue #6210 and they say it was fixed. I guess it wasn't uploaded to PyPi. - Unable to import pytorch_lightning on google colab
As said in Issue #6415 on Github, try installing from the GitHub.
It worked for me.!pip install git+https://github.com/PyTorchLightning/pytorch-lightning import pytorch_lightning as pl print(pl.__version__)
Output:1.3.0dev
It seems that the error is coming from Issue #6210 and they say it was fixed. I guess it wasn't uploaded to PyPi.
Solution 1
As said in Issue #6415 on Github, try installing from the GitHub.
It worked for me.
!pip install git+https://github.com/PyTorchLightning/pytorch-lightning
import pytorch_lightning as pl
print(pl.__version__)
Output:
1.3.0dev
It seems that the error is coming from Issue #6210 and they say it was fixed. I guess it wasn’t uploaded to PyPi.
Original Author PythonSnek Of This Content
Solution 2
Example working env: https://colab.research.google.com/drive/1GSCd3Gz3EOQIln3v065VKWKbB3_F8xqK?usp=sharing
Can you try after restarting your env.
!pip install torchtext==0.8.0 torch==1.7.1 pytorch-lightning==1.2.2
import pytorch_lightning as pl
print(pl.__version__)
...
There appears to be a bug that has not hit pip yet with pytorch lightning not referencing the newest torchtext.
Original Author Avi Thaker Of This Content
Solution 3
You can try this command, I encountered the same problem and was able to fix the problem.
!pip install --upgrade pytorch-lightning
Original Author noured Of This Content
Solution 4
Late, but if you are having similar difficulties with PyTorch Lightning Bolts you can solve it at the time of posting by making use of the same strategy:
!pip install git+https://github.com/PyTorchLightning/lightning-bolts
Original Author PatrickAllenCooper Of This Content
Conclusion
So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.