您当前的位置: 首页 >  Python

IT之一小佬

暂无认证

  • 2浏览

    0关注

    1192博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Jupyter notebook 指定 Python 解释器 anaconda

IT之一小佬 发布时间:2021-04-23 15:28:08 ,浏览量:2

Jupyter notebook 指定 Python 解释器 anaconda

打开jupyter notebook新建一个文件,发现只有一个默认的解释器,我们在指定的虚拟环境中安装了我们想要的包后是无法使用的,只有在base环境下安装的包才是可用的

接下来解决上述问题:

conda search python  # 查看当前conda镜像下能获得的版本

创建虚拟环境,安装指定的版本:

conda create -n emotiona_analysis python=3.6 # 创建名称为 emotiona_analysis 的虚拟环境,在此环境下安装 3.6python

关于创建虚拟环境更细讲解,观看博文:https://blog.csdn.net/weixin_44799217/article/details/113500335

将新创建的虚拟环境添加到 Jupyter notebook 中:

conda activate emotiona_analysis  # 切换到虚拟环境emotiona_analysis 

pip install ipykernel    #  在tensorflow  中安装 ipykernel 包

python -m ipykernel install --name emotiona_analysis   # 向 jupyter 中添加虚拟环境

打开 Jupyter notebook ,选择环境:

成功后的效果图:

移除已经安装在jupyter中的环境:

移除名字为env_xxx的环境

jupyter kernelspec remove env_xxx

关注
打赏
1665675218
查看更多评论
立即登录/注册

微信扫码登录

0.2283s