ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

Jumpserver中安装httpx

2026/9/30 0:12:43 拓冰建站 浏览量
Jumpserver中安装httpx
  1. 查看已安装的包
pip freeze
# python -V
# Python 2.7.5
  1. 安装anyio

刚开始直接pip install httpx,未设置版本号,因已有idna==2.7,所以出现版本不兼容的现象

anyio 3.0.0 requires idna>=2.8, but you have idna 2.7 which is incompatible.

尝试过后,选择anyio==1.3.0

pip install anyio==1.3.0

在这里插入图片描述

  1. 安装httpcore

    httpcore 0.13.7 requires anyio==3.*, but you have anyio 1.3.0 which is incompatible.

    httpx 0.18.0 requires httpcore<0.14.0,>=0.13.0, but you have httpcore 0.10.0 which is incompatible.

设置httpcore==0.13.0

pip install httpcore==0.13.0

在这里插入图片描述

  1. 安装httpx
pip install httpx==0.18.0

在这里插入图片描述

  1. 安装httpx[http]

在本地未安装这个包,程序就能运行,在jumpserver中不安装时出现以下错误

Using http2=True, but the 'h2' package is not installed. Make sure to install httpx using `pip install httpx[http2]`.
pip install httpx[http2]

在这里插入图片描述