美文网首页Python
conda常见命令

conda常见命令

作者: 弦好想断 | 来源:发表于2021-09-16 16:45 被阅读0次
    常用conda命令
    1 #查看帮助
    2 conda -h
    3 #查看conda版本
    4 conda --version
    5 #安装matplotlib
    6conda install matplotlib
    7 #查看已安装的包
    8 conda list
    9 #包更新
    10 conda update matplotlib
    11 #删除包
    12 conda remove matplotlib
    
    环境管理
    1 #基于python3.6版
    2本创建一一个名字为test的python独立环境
    3 conda create --name test python=3.6
    4 #查看环境列表
    5 conda info --env
    6 conda env list
    7 #激活此环境
    8 activate test
    9 source activate test # linux/ mac
    10 #退出当前环境
    11 deactivate test
    12 #删除该环境
    13 conda remove -n test --all
    14 #或者
    15 conda env remove -n test
    16
    17 #查看所有安装的python环境
    18 conda info -e
    19 # conda环境 重命名
    20 # https://www. jianshu. com/p/7265011ba3f2
    21 #先克隆一个新环境
    22 conda create -n新环境名--clone 旧环境名
    23 #再删除旧环境
    24 conda remove -n旧环境名--all
    
    
    其他命令
    1 #更新conda本身
    2 conda update conda
    3 # 更新anaconda应用
    4 conda update anaconda
    5 #更新python, 假设当前python环境是3.6.1,而最新版本是3.6.2,那么就会升级到3.6.2
    6 conda update python
    
    重命名环境
    conda其实没有重命名指令,实现重命名是通过clone完成的,分两步:
    ● 先clone一份new name的环境
    ● 删除old name的环境
    比如,想把环境rcnn重命名成tf
    第1步
    1 | conda create -n tf --clone rcnn
    
    Source:
    /anaconda3/ envs/rcnn
    Destination: /anaconda3/envs/tf
    Packages: 37
    Files: 8463 
    
    第2步
    1 | conda remove -n renn --all
    
    
    #先克隆-一个新环境
    conda create -n 新环境名 --clone 旧环境名
    #再删除旧环境
    conda remove -n 旧环境名 --all
    

    相关文章

      网友评论

        本文标题:conda常见命令

        本文链接:https://www.haomeiwen.com/subject/hkokgltx.html