OK, so original openssl is great and decent, now it's time for some easy and fancy wrappers in Python:
pip install pycryptodome
from Crypto.PublicKey import RSA
with open("privkey.pem", "rb") as f:
local_priv = RSA.import_key(f.read())
print(f"{local_priv.n = }, {local_priv.d = }")