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

相关推荐
B站_计算机毕业设计之家几秒前
计算机视觉:python车牌识别检测系统 YOLOv8 深度学习pytorch技术 LPRNet车牌识别算法 CCPD2020数据集 ✅
大数据·python·深度学习·机器学习·计算机视觉·数据分析·车牌识别
这个世界的真神4 分钟前
【每日算法】 洛谷 P12341 【[蓝桥杯 2025 省 A/Python B 第二场] 消消乐】 2025.10.26
python·算法·蓝桥杯
l1t11 分钟前
利用DeepSeek改写递归CTE SQL语句为Python程序及优化
数据库·人工智能·python·sql·算法·性能优化·deepseek
寄思~1 小时前
python批量读取word表格写入excel固定位置
开发语言·python·excel
人间乄惊鸿客2 小时前
python — day9
开发语言·python
SteveRocket6 小时前
Python机器学习与数据分析教程之pandas
python·机器学习·数据分析
bulucc8 小时前
一个简答的意图识别Agent
python·大模型·agent
Lizhihao_8 小时前
Python如何写Selenium全攻略
开发语言·python
m0_738120729 小时前
网络安全编程——TCP客户端以及服务端Python实现
python·tcp/ip·安全·web安全·网络安全