• 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
  • 相关阅读:
    59页数字乡镇综合解决方案
    IMU+摄像头实现无标记运动捕捉
    【数据分析】NumPy
    Java——JDK1.8新特性
    增强常见问题解答搜索引擎:在 Elasticsearch 中利用 KNN 的力量
    Unity之MVC思想(通过普通方法和使用MVC思想完成同一个小案例:掌握MVC简单框架)
    python入门基础
    vue3学习记录之内置组件TransitionGroup基于状态变化的过渡和动画
    SpringBoot的Cacheable缓存问题一则
    前端 JS 经典:ES6 和 CommonJs 用法
  • 原文地址:https://blog.csdn.net/weixin_42353399/article/details/136757658