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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content