conda配置虚拟环境,设置镜像源,下载安装包(以openai为例)

1.虚拟环境的查看、创建、进入、退出、删除

1.1 查看虚拟环境

conda env list 

查看现有虚拟环境

1.2 创建一个名为temp的虚拟环境,指定pyhton版本3.9.5

conda create -n temp python=3.9.5

默认安装包
创建完成

1.3 进入/退出temp环境

conda activate temp 
conda deactivate

进入到temp环境

1.4 删除环境temp

conda remove -n temp --all

2.查看当前环境的安装包、配置镜像源下载安装包

2.1 查看当前环境的安装包

conda list 

当前环境的安装包

2.2 对镜像源的操作

#查看源
conda config --show-sources
#显示现有安装源
conda config --show channels
#恢复默认源
conda config --remove-key channels
#移除外某一源
conda config --remove channels xxx
#添加某一个源并且设置搜索时显示通道地址
conda config --add channels xxx
conda config --set show_channel_urls yes
#以上操作均了修改文件.condarc,可直接找到文件修改
#添加清华源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/clooud/conda-forge/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/simpleitk
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
conda config --set show_channel_urls yes

查看源

2.3 下载openai包

#如果出现某些需要的依赖安装包安装失败,自行下载适合版本的依赖并继续执行该命令
pip install openai

下载openai

  • 3
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值