zoukankan      html  css  js  c++  java
  • conda和pip的常用语句

    jupyter 查看/添加/删除 环境的kernel信息

    jupyter kernelspec list // 查看kernel
    python -m ipykernel install --user --name 环境名 --display-name "环境名" // 添加kernel
    jupyter kernelspec remove 名称 // 删除kernel
    

    创建/删除/克隆 虚拟环境

    conda create -n 虚拟环境名 python=3.7
    conda create -n 虚拟环境名 python=3.7 -f requirements.txt  //如果有requirements.txt文件
    conda remove -n 虚拟环境名 --all
    conda create --name B --clone A
    

    重命名 虚拟环境

    conda create --name B --clone A  //先克隆新环境
    conda remove --name A --all //后删除旧环境
    

    删除安装环境的缓存文件

    conda clean --all
    

    查看/重置/添加 源

    conda config --show-sources
    conda config --remove-key channels
    
    添加源 
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --set show_channel_urls yes
    

    备份/恢复 环境

    conda env export > D:env-name.yml 备份环境到yml文件
    conda env create -f D:env-name.yml 从yml文件恢复环境
    

    环境已安装的包导出

    conda list -e > D:/requirements.txt
    pip freeze > D:/requirements.txt 或 
    pip list --format=freeze > D:/requirements.txt
    

    导入所需安装包

    conda install --yes --file requirements.txt
    pip install -r requirements.txt
    
  • 相关阅读:
    正则表达式入门
    Tyvj 1518 CPU监控——极恶线段树
    数据结构-元组
    洛谷P3195 玩具装箱TOY
    数据结构-列表基本语法
    P2569 股票交易
    列表循环
    P3507 GRA-The Minima Game
    数据结构-集合
    洛谷P1595 信封问题
  • 原文地址:https://www.cnblogs.com/lqqgis/p/14597749.html
Copyright © 2011-2022 走看看