conda pip更新安装路径,解决C盘容易不够的问题

1)pip.ini一般位置在这里

C:\Users\Lenovo\AppData\Roaming\pip

2)

打开 pip.ini只有这个

global

index-url = https://mirrors.ustc.edu.cn/pypi/web/simple

3)

pip list -v

Package Version Location Installer


aistudio-sdk 0.3.8 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

annotated-types 0.7.0 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

anyio 4.12.1 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

bce-python-sdk 0.9.59 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

bcrypt 4.2.1 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

certifi 2026.1.4 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

cffi 1.17.1 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

chardet 5.2.0 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

charset-normalizer 3.4.4 C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages pip

4)

python -m site

sys.path = [

'D:\\code\\3330',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\DLLs',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\Lib',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages',

]

USER_BASE: 'C:\\Users\\Lenovo\\AppData\\Roaming\\Python' (exists)

USER_SITE: 'C:\\Users\\Lenovo\\AppData\\Roaming\\Python\\Python312\\site-packages' (doesn't exist)

ENABLE_USER_SITE: True

5)

原来:

global

index-url = https://mirrors.ustc.edu.cn/pypi/web/simple

global

index-url = https://mirrors.ustc.edu.cn/pypi/web/simple

target = D:\Program Files\Python\Package\site-packages

修改这个target即可

6)

pip config list

global.index-url='https://mirrors.aliyun.com/pypi/simple/'

global.target='E:\\Program Files\\anaconda20230531\\Package\\site-packages'

但是运行还是不行

python -m site

sys.path = [

'D:\\code\\xxx',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\DLLs',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\Lib',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312',

'C:\\Users\\Lenovo\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages',

]

USER_BASE: 'C:\\Users\\Lenovo\\AppData\\Roaming\\Python' (exists)

USER_SITE: 'C:\\Users\\Lenovo\\AppData\\Roaming\\Python\\Python312\\site-packages' (doesn't exist)

ENABLE_USER_SITE: True

p这个也不

pip config debug

env_var:

env:

global:

C:\ProgramData\pip\pip.ini, exists: False

site:

C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\pip.ini, exists: False

user:

C:\Users\Lenovo\pip\pip.ini, exists: False

C:\Users\Lenovo\AppData\Roaming\pip\pip.ini, exists: True

global.index-url: https://mirrors.aliyun.com/pypi/simple/

global.target: E:\Program Files\anaconda20230531\Package\site-packages

7)

相关推荐
高洁012 小时前
数字孪生与计算机视觉:让机器看懂现场
人工智能·python·机器学习·transformer·迁移学习
ComPDFKit2 小时前
RAG 回答只显示 PDF 文件名?用 Python 保留引用页码
开发语言·python·pdf·rag
yz_aiks3 小时前
Termux 使用教程:把安卓手机变成随身 Linux(装 Python、SSH 远程、跑自动化脚本)
android·linux·python·智能手机·ssh·termux
2601_967980115 小时前
Flask Web 应用
python·flask·web开发·环境变量·虚拟环境
aifannihao5 小时前
ß 大写变 SS:用 Python 算清 Ruby2Shell 的缓冲区账本
python·安全·标准库·缓冲区溢出·字符串编码
liwulin05066 小时前
【OLLAMA】调用SKILL的通用ReAct
python
郝学胜-神的一滴6 小时前
Effective Python 条款36:优雅拼装迭代器与生成器
开发语言·数据结构·人工智能·python·numpy·scikit-learn
Norna8 小时前
Git 给路径加了引号,这个文件就从 review 里消失了
python
wuyk5558 小时前
Python办公自动化-第04讲-批量新建Excel
开发语言·python·excel
wuyk5558 小时前
Spider-第20讲-综合实战可上线爬虫
大数据·爬虫·python·elasticsearch