当前位置: 首页 > article >正文

python安装-升级

这里写自定义目录标题

  • 欢迎使用Markdown编辑器

欢迎使用Markdown编辑器

运行python 或pycharm时报错

[notice] A new release of pip is available: 23.1.2 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip

CMD 进入 DOS

C:\Users\wang>python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in d:\program files\python39\lib\site-packages (23.1.2)
Collecting pip
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A3617640>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。')': /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A36178E0>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。')': /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A3617BB0>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。')': /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A3617D90>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。')': /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A3617FA0>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。')': /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl
ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl (Caused by NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000289A361F190>: Failed to establish a new connection: [WinError 10051] 向一个无法连接的网络尝试了一个套接字操作。'))


[notice] A new release of pip is available: 23.1.2 -> 24.2
[notice] To update, run: python.exe -m pip install --upgrade pip

出现这种问题一般就是网络的问题,因为国内拉取代码的速度是比较慢的,尤其是pip,所以建议大家使用国内的镜像源去安装。

例如,使用阿里云、清华大学或豆瓣的镜像源替换默认的 PyPI(Python Package Index)源。在命令行中添加 --index-url 或 -i 参数指定镜像源地址,解决办法:

pip install --index-url https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --upgrade pip

C:\Users\wang>python.exe -m pip install --index-url https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com --upgrade pip
Looking in indexes: https://mirrors.aliyun.com/pypi/simple/
Requirement already satisfied: pip in d:\program files\python39\lib\site-packages (23.1.2)
Collecting pip
  Downloading https://mirrors.aliyun.com/pypi/packages/d4/55/90db48d85f7689ec6f81c0db0622d704306c5284850383c090e6c7195a5c/pip-24.2-py3-none-any.whl (1.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 3.5 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.1.2
    Uninstalling pip-23.1.2:
      Successfully uninstalled pip-23.1.2
Successfully installed pip-24.2

C:\Users\wang>

在这里插入图片描述


http://www.kler.cn/a/314173.html

相关文章:

  • linux病毒编写+vim shell编程
  • 【SpringBoot】20 同步调用、异步调用、异步回调
  • 斯坦福泡茶机器人DexCap源码解析:涵盖收集数据、处理数据、模型训练三大阶段
  • 微服务即时通讯系统的实现(客户端)----(1)
  • 深入探索离散 Hopfield 神经网络
  • Dockerfile的使用
  • Python数据分析与可视化实战指南
  • 网安面试会问到的:http的长连接和短连接
  • Kafka消息堆积问题排查
  • Pikachu靶场之csrf
  • CompletableFuture的allOf一定不要乱用!血泪史复盘
  • 重修设计模式-结构型-组合模式
  • 网络丢包定位记录(三)
  • 海外大带宽服务器连接失败怎么办?
  • Antd框架中的Select组件placeholder不显示
  • [苍穹外卖]-11数据可视化接口开发
  • Qt 窗口事件机制
  • 分页查询,pageHelper, pagehelper-spring-boot-starter
  • C++ 策略技术中的算法策略
  • 握手传输 状态机序列检测(记忆科技笔试题)_2024年9月2日
  • 构建高可用和高防御力的云服务架构第一部分:深入解析DDoS高防(1/5)
  • 财富之眼用经济思维看清世界PDF高清下载
  • 【FastAPI】服务器使用SSE实现客户端之间的广播和点对点功能
  • 给新人的python笔记(一)
  • 深度学习基本概念详解
  • flink on k8s