zoukankan      html  css  js  c++  java
  • Jupyter Notebook中使用虚拟环境

    不要安装nb_conda,会导致conda包丢失,需要重新安装anaconda。要是丢失了conda包直接再安装一次anaconda,不用卸载再安装。bash Anaconda3-2018.12-Linux-x86_64.sh -u。-u(后面加上的)是因为本身有anaconda3文件夹,然后才提示用-u的。

    1、在主环境中安装ipykernel:

    conda install ipykernel

    2、在虚拟环境中安装ipykernel:

    conda install -n 环境名称 ipykernel(或则进去虚拟环境中安装)

    3、进入虚拟环境中,将环境写入notebook的kernel中

    conda activate pytorch

    python -m ipykernel install --user --name 环境名称 --display-name "显示的名称"

    如:python -m ipykernel install --user --name pytorch --display-name pytorch

    4、重新打开jupyter:jupyter notebook

    5.删除kernel环境:

    jupyter kernelspec remove 环境名称

  • 相关阅读:
    linux 硬件信息
    docker note
    Shell cmd set note
    mysql management note
    scp noneed passwd
    update kernel
    数据包处理过程
    tcp/ip分片
    sockopt note
    Python note
  • 原文地址:https://www.cnblogs.com/zhengzian/p/13493735.html
Copyright © 2011-2022 走看看