conda创建虚拟环境的问题

博主在学习PyTorch过程中遇到conda虚拟环境中jupyter无法运行的问题。通过卸载并重新安装jupyter相关模块,成功解决了这个问题。具体解决步骤包括:卸载环境中所有jupyter相关包,然后使用conda更新依赖并强制重新安装ipykernel。
摘要由CSDN通过智能技术生成

最近在看李沐老师的pytroch教学,跟着动手实践发现了不少问题。

首先是创建虚拟环境却无法使用jupyter的问题。

使用conda创建虚拟环境

conda create -n d2l-zh python=3.8

conda activate d2l-zh

pip install d2l torch torchvision

完毕之后发现无法使用jupyter打开记事本,本人使用vscode作为编辑器,总是报错

The kernel failed to start due to the missing module 'ipykernel_launcher'. Consider installing this module. View Jupyter log for further details.

最后查询到stack overflow也有相同的情况,解决方法是:

卸载环境中的jupyter

python3 -m pip uninstall -y jupyter jupyter_core jupyter-client jupyter-console jupyterlab_pygments notebook qtconsole nbconvert nbformat jupyterlab-widgets nbclient ipykernel ipynb

之后再进行安装

conda install -c conda-forge --update-deps --force-reinstall ipykernel -y

试了一下,终于解决了前面jupyter无法运行的问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值