Thanks for the details. The PyRFC package is a Python binding around the SAP NetWeaver RFC SDK and requires the SAP NW RFC SDK to be present at build/run time; it does not work as a pure Python wheel on Linux without the SDK.
The project is archived and no longer maintained by SAP, so installation can be brittle, and your environment must match what the SDK supports.
On Linux, PyRFC builds from source and needs a C toolchain plus Cython; prebuilt wheels are only provided for some platforms (Windows/macOS and certain Ubuntu builds in the GitHub releases).
PyRFC 3.x added Python 3.11 support, so using DBR with Python 3.11 is fine from a version perspective; the failures youโre seeing are almost certainly due to missing SDK headers/libs or environment variables not being visible to the install process.
Step-by-step fix (Databricks cluster)
1) Acquire the SDK: Download SAP NW RFC SDK 7.50 PL12 from the SAP Support Portal and store the ZIP somewhere accessible (e.g., DBFS, S3). You need proper SAP credentials to access downloads.
2) Upload the SDK to DBFS: Put the ZIP at /dbfs/FileStore/nwrfcsdk/nwrfc750P_12.zip (adjust name as needed).
3) Create a global init script that:
- Installs build tooling and Cython (Linux).
- Unzips the SDK to a fixed path on every node.
- Exports SAPNWRFC_HOME and LD_LIBRARY_PATH so theyโre visible to all processes (including the โlibrariesโ user).