【pip install报SSL类错误】
Conda/pip安装依赖报错ssl
- 设置VPN(Proxy)
报错ssl相关pip错误:
pip install --proxy=http://127.0.0.1:7897 <package-name>
也可以一次配置:pip config set global.proxy http://127.0.0.1:port
pip config list
查看当前配置
- 取消VPN设置(有时候使用一些脚本会报错)
报错如下:
Traceback (most recent call last):
File "/media/c303-2/DATA1/cuiy/pyProj/StableDiffusionNew/lora-scripts/mikazuki/dataset-tag-editor/scripts/launch.py", line 101, in <module>
import interface
File "/media/c303-2/DATA1/cuiy/pyProj/StableDiffusionNew/lora-scripts/mikazuki/dataset-tag-editor/scripts/interface.py", line 12, in <module>
import gradio as gr
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
import gradio.components as components
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/components/__init__.py", line 1, in <module>
from gradio.components.annotated_image import AnnotatedImage
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/components/annotated_image.py", line 13, in <module>
from gradio.components.base import IOComponent, _Keywords
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/components/base.py", line 29, in <module>
from gradio.blocks import Block, BlockContext
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/blocks.py", line 28, in <module>
from gradio import (
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/networking.py", line 20, in <module>
from gradio.routes import App
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/gradio/routes.py", line 99, in <module>
client = httpx.AsyncClient()
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/httpx/_client.py", line 1395, in __init__
proxy_map = self._get_proxy_map(proxies, allow_env_proxies)
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/httpx/_client.py", line 216, in _get_proxy_map
return {
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/httpx/_client.py", line 217, in <dictcomp>
key: None if url is None else Proxy(url=url)
File "/usr/local/anaconda3/envs/lora_env/lib/python3.10/site-packages/httpx/_config.py", line 336, in __init__
raise ValueError(f"Unknown scheme for proxy URL {url!r}")
禁用代理:
unset HTTP_PROXY HTTPS_PROXY NO_PROXY ALL_PROXY
unset http_proxy https_proxy no_proxy all_proxy