# Installing python packages for Python 3.11 on Rocky Linux 9.3 (Blue Onyx)

**URL:** <https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [April 3, 2024, 11:57am UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447 "2024-04-03T11:57:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![shailesh\_vaidya](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/shailesh_vaidya/32/1670_2.png) [@shailesh\_vaidya](https://forums.rockylinux.org/u/shailesh_vaidya)\
**Post date:** [April 3, 2024, 11:57am UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/1 "2024-04-03T11:57:35Z")

</div>

Hello Team,

We are trying to migrate our existing application from Python 3.9 to Python 3.11 . We observed that RPM’s for following Python packages are not available for Python 3.11.

- iotop - Installed by iotop-0.6-30.el9.noarch RPM
- nftables - installed by python3-nftables-1.0.4-10.el9\_1.x86\_64 RPM
- sepolicy - python3-policycoreutils-3.5-1.el9.noarch RPM
- subscription-manager - subscription-manager-1.29.33.1-1.el9\_2.x86\_64 RPM

These RPM’s are installing only for Python 3.9 and RPM’s for Python 3.11 are not available. Python 3.11 RPM package are available for few of Python packages. e.g.

python3.11-setuptools python3.11-gpg python3.11-rpm

Can you please check and confirm if this support is not added yet.

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [April 3, 2024, 12:09pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/2 "2024-04-03T12:09:07Z")

</div>

Default system python is 3.9, so dependencies won’t change for this. You can use python3.11, but the operating system will still need python3.9 for system-related stuff and this will not change for the entirety of Rocky 9.x - even future versions.

Rocky is based on RHEL, so it is the same as RHEL. If RHEL don’t change/update their package versions, Rocky won’t see those updates either. Rocky will not digress from package versions as Rocky aims to be 1:1 with RHEL.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 3, 2024, 12:45pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/3 "2024-04-03T12:45:42Z")

</div>

One can basically see three “subsets”:

- There is python. The “executable”
- There are modules for python. “Libraries”
- There are applications that run on python

The OS has “platform python” that – as said – will remain same until EOL of the distro.  
There are alternative python versions (e.g. the 3.11) for _user applications_.

There are _some_ modules (e.g. numpy) as RPM for each available python version, so that all users do not have to fetch all modules for their own needs (e.g. with `pip install --user` or venv).

The dnf, nft, iotop, etc are _system applications_ that run with the platform python and hence stick to that version.

* * *

Look at [Red Hat Enterprise Linux Application Streams Life Cycle - Red Hat Customer Portal](https://access.redhat.com/support/policy/updates/rhel-app-streams-life-cycle)  
You should see that the Python 3.9 is supported to EOL of EL9, May 2032,  
but the Python 3.11 _application stream_ will retire already in May 2026.

If, for example, the package manager (dnf) would be shifted to depend on 3.11 now, then it would have to be shifted to 3.11+x relatively soon. IMHO, such frequent porting would be wasted effort and expose dnf to “novel bugs”. If the package management, firewall, and whatnot of distro are eaten by bugs, then nobody is happy …

---

<div class="post-metadata">

**Author:** ![ganphx](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/ganphx/32/2381_2.png) [@ganphx](https://forums.rockylinux.org/u/ganphx)\
**Post date:** [April 3, 2024, 6:19pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/4 "2024-04-03T18:19:22Z")

</div>

Python 3.11 and the upcoming release of Python 3.12 in 9.4 are for maintenance/development work due to “breaking changes”, the removal of depreciated functions".

> **[Python Release Python 3.12.1](https://www.python.org/downloads/release/python-3121/)**
>
> The official home of the Python Programming Language

---

<div class="post-metadata">

**Author:** ![shailesh\_vaidya](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/shailesh_vaidya/32/1670_2.png) [@shailesh\_vaidya](https://forums.rockylinux.org/u/shailesh_vaidya)\
**Post date:** [April 3, 2024, 6:22pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/5 "2024-04-03T18:22:39Z")

</div>

Hi @iwalker and @jlehtone - Thanks for your responses.

I agree that default Python version for Rocky Linux 9.2 will remain at 3.9 and 3.11 package are made available through appstream only.

I just want to confirm that RPM packages for mentioned Python packages are not provided by Rocky Linux itself. As 3.11 version RPM packages are available for few of Python packages

Also I hope we can install metntioned package through tarball on system. Please let me know if there is any other alternatives.

Regards,  
Shailesh Vaidya

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [April 3, 2024, 6:41pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/6 "2024-04-03T18:41:04Z")

</div>

Better than tarball, would be to use `pip3 install`. They can be easily removed as well.

You can check [https://pkgs.org](https://pkgs.org) to see if any Python 3.11 packages exist potentially for EL distributions in say EPEL or other repositories.

---

<div class="post-metadata">

**Author:** ![shailesh\_vaidya](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/shailesh_vaidya/32/1670_2.png) [@shailesh\_vaidya](https://forums.rockylinux.org/u/shailesh_vaidya)\
**Post date:** [April 3, 2024, 7:38pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/7 "2024-04-03T19:38:53Z")

</div>

@iwalker

pip3 install could not find required package.

```auto
sh-5.1# pip3 install nftables 
ERROR: Could not find a version that satisfies the requirement nftables (from versions: none)
ERROR: No matching distribution found for nftables

```

When I trace back for Python 3.9. I found that it’s installed through python3-nftables RPM package.

```auto
sh-5.1# rpm -q --filesbypkg python3-nftables
python3-nftables /usr/lib/python3.9/site-packages/nftables
python3-nftables /usr/lib/python3.9/site-packages/nftables-0.1-py3.9.egg-info
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __init__.py
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __pycache__
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __pycache__ / __init__.cpython-39.opt-1.pyc
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __pycache__ / __init__.cpython-39.pyc
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __pycache__ /nftables.cpython-39.opt-1.pyc
python3-nftables /usr/lib/python3.9/site-packages/nftables/ __pycache__ /nftables.cpython-39.pyc
python3-nftables /usr/lib/python3.9/site-packages/nftables/nftables.py
python3-nftables /usr/lib/python3.9/site-packages/nftables/schema.json
sh-5.1#

```

I could not find 3.11 equivalent package in [https://pkgs.org](https://pkgs.org/) also.

Regards,  
Shailesh Vaidya

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [April 3, 2024, 7:53pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/8 "2024-04-03T19:53:58Z")

</div>

This sounds like an XY problem. You’ve asked X (involving package support for 3.11 and system packages like nftables), solving for Y (which you’ve not sufficiently answered; migrating an application is not the answer). What is it that you’re actually trying to achieve by using python 3.11 alongside nftables, selinux, and subscription manager?

Why does your application need python 3.11 when the system default (which everything on the system relies on) is 3.9?

---

<div class="post-metadata">

**Author:** ![shailesh\_vaidya](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/shailesh_vaidya/32/1670_2.png) [@shailesh\_vaidya](https://forums.rockylinux.org/u/shailesh_vaidya)\
**Post date:** [April 3, 2024, 8:18pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/9 "2024-04-03T20:18:35Z")

</div>

@label -

Apologies if it was confusing. I listed those Python 3.9 packages and am checking their availability in Python 3.11 as part of migration effort. Hence, I posted this query. I will try to explore how these packages are actually used in my application

We are trying to move to 3.11 as latest Python release in security status. As 3.9 will be EOL in 2025-10

Regards,  
Shailesh

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [April 3, 2024, 8:39pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/10 "2024-04-03T20:39:22Z")

</div>

Python 3.9 will be remain default python on Rocky Linux 9. Even beyond the end of life date, python 3.9 will be here to stay. Trying to force system utilities and libraries to use a newer python will cause various issues, if not break your system.

Standalone applications that need a newer python can use python 3.11 (and python 3.12 when it is released with rocky linux 9.4). There should be no expectation, however, of being able to hook into the system packages/libraries in python3.11 as it is _not_ the default python.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 3, 2024, 9:15pm UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/11 "2024-04-03T21:15:42Z")

</div>

> [@shailesh\_vaidya](#):
>
> We are trying to move to 3.11 as latest Python release in security status. As 3.9 will be EOL in 2025-10

_Upstream_ Python 3.9 will EOL 2025-10. RHEL 9/Rocky 9 Python “3.9” will EOL 2032-05 and will be kept secure all the way.

The “Python 3.9” in RHEL 9 is not the upstream version. It is something that was forked from upstream version by Red Hat into separate branch that is maintained by RH with _backports_: [https://access.redhat.com/solutions/57665](https://access.redhat.com/solutions/57665)

* * *

One simply does not mess with the core components (like nftable) of Enterprise Linux. If one does, the result is no more EL, will probably break, and you can keep the pieces (preferably isolated from all networks).

---

<div class="post-metadata">

**Author:** ![derkuci](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@derkuci](https://forums.rockylinux.org/u/derkuci)\
**Post date:** [April 7, 2024, 1:14am UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/12 "2024-04-07T01:14:06Z")

</div>

Even though RHEL 9 will keep maintain Python 3.9 until 2032, most python packages will not do the same. Quite some packages already dropped Python 3.7, and based on past experience, their support for Python 3.9 will also be dropped soon after its EOL in 2025. My feeling is that in recent years, Python and its ecosystem evolve much faster, and sticking to one version for 10 years is getting harder and harder.

I used to copy .spec from Fedora and build my own python39-XXX rpms on Rocky 8. With Rocky 9, doing so for Python 3.11 or 3.12 is a bit more diffcult as Redhat changed their policy on supporting non-default Python versions. For example, as stated in this thread, switching the system-default python would cause issues (and DNF is just recently changed to hard-coding python3.9 instead of python3). I wonder if using venv+pip would be a more viable solution.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 7, 2024, 10:41am UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/13 "2024-04-07T10:41:45Z")

</div>

> [@derkuci](#):
>
> I wonder if using venv+pip would be a more viable solution.

On assumption that most _user applications_ are not in RPM-packages and do have their own requirements for what Python modules they do use, I’d say “yes”. Up to distinct venv for each application. IMHO, in worst case via _conda_.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [June 6, 2024, 10:41am UTC](https://forums.rockylinux.org/t/installing-python-packages-for-python-3-11-on-rocky-linux-9-3-blue-onyx/13447/14 "2024-06-06T10:41:51Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
