Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
iakovgan opened this issue Aug 22, 2015 · 2 comments

Comments

@iakovgan
Copy link
Contributor

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",
  }
@ghoneycutt ghoneycutt removed their assignment Aug 22, 2015
@iakovgan
Copy link
Contributor Author

correction:

a better workaround of this issue might be via /ètc/ld.so.conf.d :

  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/ld.so.conf.d/${python::python_version}.conf":
    content => "$ld_lib_path\n",
  }

@stankevich
Copy link
Collaborator

Possibly fixed in #314, please verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants