pip和conda添加和删除镜像源

conda不小心安装了一个同名的环境,不小心就把原来搞了两天的旧环境覆盖了,气死了,这里记录一下再来一遍的过程

conda create --name nerfstudio -y python=3.8

python -m ensurepip --default-pip

conda remove --name env_name --all

D:\miniconda\envs\nerfstudio\python.exe -m pip install pip==23.1.2

python.exe -m pip install --upgrade pip==23.0.1

【WARNING:Ignore distutils configs in setup.cfg due to encoding errors】完美解决

【WARNING:Ignore distutils configs in setup.cfg due to encoding errors】完美解决_warning: ignore distutils configs in setup.cfg due-CSDN博客

pip和conda添加和删除镜像源

一、pip

1、添加源

比如添加清华源https://pypi.tuna.tsinghua.edu.cn/simple:

pip国内的一些镜像

• 阿里云 http://mirrors.aliyun.com/pypi/simple/

• 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

• 豆瓣(douban) http://pypi.douban.com/simple/

• 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/

• 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

or

pip config set global.index-url http://pypi.mirrors.ustc.edu.cn/simple/

如果set多次,似乎只能保存最后一次set的镜像源。

2、删除源

pip config unset global.index-url

3、查看现在用的哪个源

pip config list

二、conda

1、添加源

比如清华源:

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

2、删除源

conda config --remove-key channels

3、查看现在用的是哪些源

conda config --show channels

也可以使用

conda config --show-sources

相关推荐
猿界零零七14 分钟前
pip install mxnet 报错解决方案
python·pip·mxnet
不只会拍照的程序猿2 小时前
《嵌入式AI筑基笔记02:Python数据类型01,从C的“硬核”到Python的“包容”》
人工智能·笔记·python
Jay_Franklin2 小时前
Quarto与Python集成使用
开发语言·python·markdown
Oueii3 小时前
Django全栈开发入门:构建一个博客系统
jvm·数据库·python
2401_831824963 小时前
使用Fabric自动化你的部署流程
jvm·数据库·python
njidf4 小时前
Python日志记录(Logging)最佳实践
jvm·数据库·python
@我漫长的孤独流浪4 小时前
Python编程核心知识点速览
开发语言·数据库·python
宇擎智脑科技4 小时前
A2A Python SDK 源码架构解读:一个请求是如何被处理的
人工智能·python·架构·a2a
2401_851272994 小时前
实战:用Python分析某电商销售数据
jvm·数据库·python
vx_biyesheji00014 小时前
Python 全国城市租房洞察系统 Django框架 Requests爬虫 可视化 房子 房源 大数据 大模型 计算机毕业设计源码(建议收藏)✅
爬虫·python·机器学习·django·flask·课程设计·旅游