jupyter notebook中使用pytorch

jupyter notebook中使用pytorch

1.问题

在使用pytorch时,使用jupyter notebook无法调用,也没有可以调整更改的环境

错误提示:No module named ‘torch‘

image

2.解决方法

前提:anaconda+pytorch已经安装好

conda install ipython

conda install jupyter

python -m ipykernel install --user --name "别名(可以是创建的盒子名)"

如果是实心:

pip uninstall pyzmq
pip install pyzmq==19.0.2
- E:\AI\anaconda\Lib\site-packages\menuinst\platforms\win.py:69: UserWarning: Quick launch menus are not available for system level installs
  warnings.warn("Quick launch menus are not available for system level installs")
\ Terminal profiles are not available for system level installs

3.numpy问题

安装numpy版本为1.26.2即可解决问题

conda activate DP_learn
conda install numpy=1.26.2

image

posted @ 2025-06-03 12:47  小西贝の博客  阅读(104)  评论(0)    收藏  举报