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

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

记录一下遇见的python问题。

vscode切换环境

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

> select interpreter

然后选择需要的环境。

pip安装库网络错误

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

pip install -r requirements.txt

出现:

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

解决:加镜像源

pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple
/ --trusted-host mirrors.aliyun.com

相关推荐

  1. 离线环境安装python(推荐pip download)

    2024-03-17 05:46:01       63 阅读
  2. Python pip安装如何切换国内源

    2024-03-17 05:46:01       33 阅读
  3. vscode无法切换env环境

    2024-03-17 05:46:01       28 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-17 05:46:01       91 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-17 05:46:01       97 阅读
  3. 在Django里面运行非项目文件

    2024-03-17 05:46:01       78 阅读
  4. Python语言-面向对象

    2024-03-17 05:46:01       88 阅读

热门阅读

  1. python opencv的最基础初学

    2024-03-17 05:46:01       42 阅读
  2. C---流

    C---流

    2024-03-17 05:46:01      31 阅读
  3. Linux-centos系统中如何去除配置文件中的注释部分

    2024-03-17 05:46:01       39 阅读
  4. LLMOps:机器学习运营的下一个前沿

    2024-03-17 05:46:01       39 阅读
  5. 数据结构 第4章 串(一轮习题总结)

    2024-03-17 05:46:01       39 阅读
  6. npm install报错

    2024-03-17 05:46:01       43 阅读
  7. 数据结构-哈希表(一)

    2024-03-17 05:46:01       43 阅读