[Python] How to install httpx[http2] in WSL2

Discussão em 'Python' iniciado por Stack, Abril 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm making a python program to test a web-server I am making. I use httpx and wanted to use http2 as well, to be able to send http version 2 requests. The only way I find to install it is pip install httpx[http2], but pip is not working on WSL (error: externally-managed-environment). I got around this with https by doing python3-pip install httpx but python3-pip install httpx[http2] does not seem to work or any other variants I have tried.

    To clarify both my web server and python program is running in WSL.

    The error that made me look into http2 was:

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

    Continue reading...

Compartilhe esta Página