【pip install报SSL类错误】

Conda/pip安装依赖报错ssl

  1. 设置VPN(Proxy)
    报错ssl相关pip错误:
bash 复制代码
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查看当前配置

  1. 取消VPN设置(有时候使用一些脚本会报错)
    报错如下:
bash 复制代码
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}")

禁用代理:

bash 复制代码
unset HTTP_PROXY HTTPS_PROXY NO_PROXY ALL_PROXY
unset http_proxy https_proxy no_proxy all_proxy
相关推荐
运维&陈同学几秒前
【Elasticsearch05】企业级日志分析系统ELK之集群工作原理
运维·开发语言·后端·python·elasticsearch·自动化·jenkins·哈希算法
新手小袁_J1 小时前
实现Python将csv数据导入到Neo4j
数据库·python·neo4j·《我是刑警》·python连接neo4j·python导入csv·csv数据集导入neo4j
清风ꦿ1 小时前
neo4j 图表数据导入到 TuGraph
python·neo4j·knowledge graph
深度学习lover3 小时前
[项目代码] YOLOv8 遥感航拍飞机和船舶识别 [目标检测]
python·yolo·目标检测·计算机视觉·遥感航拍飞机和船舶识别
水木流年追梦4 小时前
【python因果库实战10】为何需要因果分析
开发语言·python
m0_675988235 小时前
Leetcode2545:根据第 K 场考试的分数排序
python·算法·leetcode
凡人的AI工具箱7 小时前
每天40分玩转Django:Django测试
数据库·人工智能·后端·python·django·sqlite
qyq17 小时前
Django框架与ORM框架
后端·python·django
企业软文推广7 小时前
企业如何选择媒体发稿平台及相关事项?媒介盒子分享
python
JM_life7 小时前
你的第一个博客-第一弹
python