Python package openai only installs as version 0.8.0

I installed the Python package openai using the pip3 package installer on Red Hat Enterprise Linux 8.6 with the following command:

pip3 install openai

This command installs the latest compatible version of the package, which apparently is version 0.8.0:

dev@devhost:/home/dev> pip show openai
Name: openai
Version: 0.8.0
Summary: Python client library for the OpenAI API
Home-page: https://github.com/openai/openai-python
Author: OpenAI
Author-email: support@openai.com
License: UNKNOWN
Location: /home/dev/.local/lib/python3.6/site-packages
Requires: requests, tqdm
Required-by: gpt-index

But I actually wanted version 0.26.4 installed, not 0.8.0. So I tried to force install that version as shown:

dev@devhost:/home/dev> pip install openai==0.26.4
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement openai0.26.4 (from versions: 0.0.2, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.4.0, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.7.0, 0.8.0, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.10.4, 0.10.5)
ERROR: No matching distribution found for openai==0.26.4

The version I wanted is not available apparently, and this confused me.

It turned out that the openai package 0.26.4 is not available for Python version lower than 3.7, and I was running on Python 3.6.8:

dev@devhost:/home/dev> python --version
Python 3.6.8

So the solution is to upgrade the Python package (which was a challenging task on RHEL 8.6, which is a whole different story).