• python问题:vscode切换环境,pip安装库网络错误


    python问题:vscode切换环境,pip安装库网络错误

    记录一下遇见的python问题。

    vscode切换环境

    在vscode上面的搜索框输入
    在这里插入图片描述

    > select interpreter
    
    • 1

    然后选择需要的环境。

    pip安装库网络错误

    用requirements.txt来安装需要的依赖包及其版本号,

    pip install -r requirements.txt
    
    • 1

    出现:

    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/gymnasium/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/gymnasium/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/gymnasium/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/gymnasium/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))': /simple/gymnasium/
    Could not fetch URL https://pypi.org/simple/gymnasium/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/gymnasium/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) - skipping
    ERROR: Could not find a version that satisfies the requirement gymnasium==0.28.1 (from versions: none)
    ERROR: No matching distribution found for gymnasium==0.28.1
    Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:997)'))) - skipping
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    解决:加镜像源

    pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple
    / --trusted-host mirrors.aliyun.com
    
    • 1
    • 2
  • 相关阅读:
    JS重启自动运行加载视频错误
    ros2与windows入门教程-windows上安装ROS2 foxy
    文本挖掘技术研究_笔记
    MySQL运维15-一主一从读写分离
    第五章、ansible变量配置与机密
    easyrecovery15数据恢复软件收费吗?功能强大吗?
    B024 – STM32温湿度控制体温检测烟雾报警系统
    【Android Studio】简单的QQ登录界面
    es6新特性(超详细)
    ROS 2官方文档(基于humble版本)学习笔记(三)
  • 原文地址:https://blog.csdn.net/weixin_42353399/article/details/136757658