selinux
shim selinux module
Decision gist · record as of 2026-08-14
Yes, if you need to use selinux from inside a virtualenv. The package solves a specific problem with minimal dependencies, no security issues, active maintenance status. The gap since the latest release is a minor concern, but the package remains actively maintained, marked Production/Stable. Install only if you encounter the virtualenv selinux import problem.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- libselinux Python bindings must be installed on the system; the shim bridges access to them from within a virtualenv.
- Low install friction with a single runtime dependency (distro).
- The package is actively maintained with recent commits, though the latest release was over three years ago; it remains marked as Production/Stable with support for current Python versions.
License · maintenance · safety
MIT license (permissive) — MIT license permits unrestricted use, modification, in both open-source, proprietary projects with minimal obligations.
last release 2022-12-24 (1329 days) · last repo commit 2026-07-13 · 19 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,761,246 downloads/mo, #3,583 on PyPI
Alternatives
Verify before relying
pip install selinux
import selinux- Whether the shim works with all selinux functions or only a subset of the API
- Whether it works with selinux versions other than those tested at release time
- Compatibility with Ansible modules specifically
What it is and what it does
This package is a workaround for a specific virtualenv limitation: selinux normally cannot be imported from inside isolated Python environments even when the system library is installed. The selinux shim bridges that gap by providing a pure-Python wrapper that allows code running in a virtualenv to import selinux.
The shim requires that libselinux Python bindings be present on the host system—it does not replace them, only makes them accessible from within a virtualenv. It has been tested to work both inside, outside virtualenvs without interfering with the original library. The package depends only on distro for runtime operation, supports Python 3.9 or later.
Use it for
- Importing selinux in isolated Python environments for system administration tasks
- Testing or developing tools that depend on selinux in a containerized or virtualenv-based CI/CD pipeline
- Running code that requires selinux from within a virtualenv without system-level workarounds
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to use selinux from inside a virtualenv.
The package solves a specific problem with minimal dependencies, no security issues, active maintenance status. The gap since the latest release is a minor concern, but the package remains actively maintained, marked Production/Stable. Install only if you encounter the virtualenv selinux import problem.
Install
selinux on PyPI
Before you install
Low install friction with a single runtime dependency (distro). The package is actively maintained with recent commits, though the latest release was over three years ago; it remains marked as Production/Stable with support for current Python versions.
libselinux Python bindings must be installed on the system; the shim bridges access to them from within a virtualenv.
License in practice
MIT license permits unrestricted use, modification, in both open-source, proprietary projects with minimal obligations.
Quickstart
pip install selinux
import selinux
Verify before relying
- Whether the shim works with all selinux functions or only a subset of the API
- Whether it works with selinux versions other than those tested at release time
- Compatibility with Ansible modules specifically
Package facts
| License | MIT license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagedistro |
| Maintenance | Actively maintained 1,329 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,761,246 / month, #3,583 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: System :: Systems AdministrationTopic :: Utilities |
Evidence: selinux-0.3.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “selinux virtualenv import”
- selinuxProvides a pure-Python shim for the selinux module that works inside…
- ruyamlruyaml is a YAML parser and serializer that preserves comments,…
- rpmProvides access to system RPM Python bindings inside a virtualenv by…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also rpm · virtualenv-clone · virtualenv · ansible-dev-environment · nodeenv · ansible-compat · notebook-shim · isolate · modal-client · logfire-api