Linux设置pip环境

发布于:2025-02-10 ⋅ 阅读:(53) ⋅ 点赞:(0)

python在pip install时报错

(birefnet) wyw@star-SYS-420GP-TNR:~/matting/BiRefNet$ pip install -i http://yum.tbsite.net/aliyun-pypi/simple xlab-image-effect
Looking in indexes: http://yum.tbsite.net/aliyun-pypi/simple
WARNING: The repository located at yum.tbsite.net is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with '--trusted-host yum.tbsite.net'.
ERROR: Could not find a version that satisfies the requirement xlab-image-effect (from versions: none)
ERROR: No matching distribution found for xlab-image-effect

(birefnet) wyw@star-SYS-420GP-TNR:~/matting/BiRefNet$ pip install -i https://artifacts.antgroup-inc.cn/simple xlab-image-effect
Looking in indexes: https://artifacts.antgroup-inc.cn/simple
ERROR: Could not find a version that satisfies the requirement xlab-image-effect (from versions: none)
ERROR: No matching distribution found for xlab-image-effect

解决方法

mkdir ~/.pip
vim ~/.pip/pip.conf

写入以下内容并保存

[global]
index-url = http://yum.tbsite.net/aliyun-pypi/simple
extra-index-url = https://artifacts.antgroup-inc.cn/simple
                  https://pypi.mirrors.ustc.edu.cn/simple
                  http://yum.tbsite.net/aliyun-pypi/simple
                  https://pypi.tuna.tsinghua.edu.cn/simple
disable-pip-version-check = true
timeout = 3600

[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
               artifacts.antgroup-inc.cn
               pypi.mirrors.ustc.edu.cn
               yum.tbsite.net

直接安装即可

pip install xlab-image-effect