httpx command not found

In this troubleshooting guide we learn how to fix httpx command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

httpx: command not found

or when using sudo you get the following error message

sudo: httpx: command not found

Solutions to httpx: command not found

How To Fix httpx: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu httpx is provided by python3-httpx package.

python3-httpx is:

HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.

HTTPX is a high performance asynchronous HTTP client, that builds on the well-established usability of requests, and gives you:

  • A broadly requests-compatible API.
  • Standard synchronous interface, but with async support if you need it.
  • HTTP/1.1 and HTTP/2 support.
  • Ability to make requests directly to WSGI applications or ASGI applications.
  • Strict timeouts everywhere.
  • Fully type annotated.
  • 99% test coverage.

Plus all the standard features of requests:

  • International Domains and URLs
  • Keep-Alive & Connection Pooling
  • Sessions with Cookie Persistence
  • Browser-style SSL Verification
  • Basic/Digest Authentication
  • Elegant Key/Value Cookies
  • Automatic Decompression
  • Automatic Content Decoding
  • Unicode Response Bodies
  • Multipart File Uploads
  • HTTP(S) Proxy Support
  • Connection Timeouts
  • Streaming Downloads
  • .netrc Support
  • Chunked Requests

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-httpx

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-httpx.

sudo apt -y install python3-httpx

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-httpx

Summary

In this tutorial we learn how to fix httpx command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.