【Python搭配环境】

本文介绍了如何使用conda创建虚拟环境,并详细讲解了如何在Anaconda下安装和配置PyTorch及TensorFlow,包括验证安装、更新与卸载的方法。同时,文章还列举并解决了conda安装过程中可能出现的各种错误,如CondaHTTPError和环境版本冲突等。最后,简要提及了GPU使用情况的检查和Git的基本操作。
摘要由CSDN通过智能技术生成

创建虚拟环境

创建:conda create -n huxw3 python=3.6.8
激活:conda activate huxw(进入到env后进行conda或pip)
进入:source activate huxw 
退出:source deactivate
删除:conda env remove -n huxw3.7

conda 添加/移除指定源

  • 查看源
conda config --show-sources
查看镜像源命令:conda config --show channels
移除镜像源命令:conda config --remove-key channels
  • 添加国内源(下载很快)
# 清华源
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# 中科大源
conda config –-add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ 
# 阿里云源
conda config --add channels http://mirrors.aliyun.com/pypi/simple/

conda config --set show_channel_urls yes
  • 删除
conda config --remove channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/'
  • 恢复默认源
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值