semanage command throws "ImportError: /usr/lib64/python2.7/site-packages/selinux/_selinux.so: undefined symbol: setexecfilecon"

Solution Verified - Updated -

Issue

  • semanage command throws "ImportError: /usr/lib64/python2.7/site-packages/selinux/_selinux.so: undefined symbol: setexecfilecon"
# semanage fcontext -a -t selinux_config_t /etc/selinux/config
Traceback (most recent call last):
  File "/sbin/semanage", line 32, in <module>
    import seobject
  File "/usr/lib/python2.7/site-packages/seobject/__init__.py", line 26, in <module>
    import selinux
  File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 26, in <module>
    _selinux = swig_import_helper()
  File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 22, in swig_import_helper
    _mod = imp.load_module('_selinux', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/selinux/_selinux.so: undefined symbol: setexecfilecon

Environment

  • Red Hat Enterprise Linux 7
  • selinux-policy
  • libselinux

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.