SUSE-family Python hosts can install scikit-learn from distribution repositories when the project should follow operating-system-managed scientific Python packages. The packaged build brings in NumPy, SciPy, joblib, threadpoolctl, and BLAS dependencies through zypper instead of mixing them into the managed Python with pip.
On openSUSE Leap and SUSE Linux Enterprise systems with SUSE Package Hub enabled, the package name is python3-scikit-learn and the import name remains sklearn. Repository versions track the distribution support policy, so they may be older than the latest upstream release while still receiving distro-maintained updates.
Use this path for a system Python environment shared by scheduled jobs, server processes, or operating-system packages. For project-specific upstream releases, create a virtual environment and install with pip or conda instead of using sudo pip against the managed Python.
Steps to install scikit-learn on SUSE Linux:
- Open a terminal with sudo privileges.
- Refresh zypper repository metadata.
$ sudo zypper refresh All repositories have been refreshed.
- Install the scikit-learn package.
$ sudo zypper install --no-confirm python3-scikit-learn
zypper installs the Python package and its scientific-computing dependencies, including NumPy and SciPy. On SUSE Linux Enterprise, enable SUSE Package Hub first if the package is not found.
- Confirm Python can import sklearn and print the installed version.
$ python3 -c "print(__import__('sklearn').__version__)" 0.23.2The version shown depends on the enabled SUSE repository. A successful import proves the package is visible to the default python3 interpreter.
- Run a small estimator smoke test.
$ python3 - <<'PY' from sklearn.datasets import load_iris from sklearn.neighbors import KNeighborsClassifier X, y = load_iris(return_X_y=True) model = KNeighborsClassifier(n_neighbors=3).fit(X, y) print(model.predict(X[:3]).tolist()) PY [0, 0, 0]
The prediction output confirms scikit-learn can load a bundled dataset, fit an estimator, and return predictions from the installed package.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.