UV安装报错解决 疑难杂症
目录
背景和价值
通过uv list能看到安装的包,但是pycharm找不到,而且排查pycharm 虚拟环境配置没有问题
先卸载
uv remove pydantic-core
强制重新安装(会重新拉取并解压二进制包)
uv add --force-reinstall pydantic-core
uv pip install llama-index llama-index-embeddings-huggingface
报错
(New-User-Acquisition-Bot) MacBook-Pro-3:New-User-Acquisition-Bot$ uv pip install llama-index llama-index-embeddings-huggingface
⠙ Resolving dependencies... error: Failed to fetch: `https://pypi.org/simple/llama-index-embeddings-huggingface/`
Caused by: Request failed after 3 retries
Caused by: error sending request for url (https://pypi.org/simple/llama-index-embeddings-huggingface/)
Caused by: client error (Connect)
Caused by: Connection reset by peer (os error 54)
但是在浏览器访问 https://pypi.org/simple/llama-index-embeddings-huggingface/ 是OK的
解决办法1 - 镜像源加速
uv pip install llama-index-embeddings-huggingface -i https://mirrors.aliyun.com/pypi/simple/
解决办法2
本地下载安装
pip download llama-index-embeddings-huggingface -d ./packages
uv pip install --no-index --find-links=./packages llama-index-embeddings-huggingface
解决办法3
重启电脑
【有时候因为开了**软件,会影响安装,重启后药到病除】
诊断方法
curl -v https://mirrors.aliyun.com/pypi/simple/numpy/

浙公网安备 33010602011771号