Skip to content

SCL python27: add a workaround for libpython2.7.so.1.0 issue (LD_LIBRARY_PATH) #234

@iakovgan

Description

@iakovgan

Unsing SCL python27 we frequently run into an isssue with python when it can't find libpython2.7.so.1.0. Looks like there are a lot of ways of handeling this issue, but the simpliest was just adding an env variable LD_LIBRARY_PATH. I suppose it is a well known issue(see stackoverflow link in the code).

Here is a workaround:

  # Set env variable LD_LIBRARY_PATH
  # see http://stackoverflow.com/questions/7880454/python-executable-not-finding-libpython-shared-library
  if $python::python_version == 'python-2.6.6' {
    $ld_lib_path = '/usr/lib64/python2.6'
  } else {
    $ld_lib_path = "/opt/rh/${python::python_version}/root/usr/lib64/"
  }
  file { '/etc/profile.d/set_ld_lib_path_for_python.sh':
    mode    => '0755',
    content => "export LD_LIBRARY_PATH=${ld_lib_path}\n",
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions