본문 바로가기
ML or DL/개발환경

[Jupyter notebook] Jupyter Notebook에서 import torch 안될 때

by chaloalto 2021. 10. 26.

Anaconda IDE 에서는 python >> import torch 가 정상 작동하나 
jupyter notebook을 실행해서 import torch 를 하면 모듈 불러오기가 불가능할 때, 

해결방법 : pytorch를 설치한 후, conda로 jupyter notebook을 다시 설치

conda install jupyter

pytorch 설치 후 jupyter notebook을 conda로 설치해주면 torch 환경을 jupyter notebook kernel에서 사용할 수 있게 된다.

* 다른 방법으로는 pytorch 설치 이후 jupyter notebook에 ipykernel을 추가

출처 : https://keepdev.tistory.com/51