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

Pass through LD_LIBRARY_PATH environment variable by default #265

Closed
pytoxbot opened this Issue Sep 17, 2016 · 6 comments

Comments

Projects
None yet
1 participant
@pytoxbot

pytoxbot commented Sep 17, 2016

I develop on RHEL6 using Python 2.7.8. I am having trouble using tox. When I run

$ tox -e py27

I receive the following error message:

sqlparse-0.1.14/.tox/py27/bin/python2: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

The reason for this error is because the environment variable LD_LIBRARY_PATH is not being passed. I can work around this by passing it in tox.ini which does work. The reason I bring this up is that this variable is of fundamental importance to how RedHat Software Collections work and I think this variable should be passed by default on Unix systems. In the next paragraph I will briefly describe what Software Collections are and how they work.

RedHat installs alternative versions of Python, distinct from the system version, in what they call Software Collections (SCLs). These software collections are separate self-contained trees of software that are installed in /opt. There are SCLs for Python27, Python33, and Python34. The default python interpreter for RHEL6 is Python26. These alternative interpreters can be enabled by the user either individually or collectively using a command line script called scl. This script works simply by setting the users PATH and LD_LIBRARY_PATH, among other environment variables.

When tox -e py27 runs it will find the python27 interpreter on the PATH but the interpreter will fail because it can not find its necessary libraries because LD_LIBRARY_PATH is not being properly set by tox. If this environment variable is not set any software on the PATH that is in an SCL will fail if it has a library dependency installed in an SCL. I would recommend that you add LD_LIBRARY_PATH as a default environment variable to be passed by tox. You may also want to consider the following which are also set by SCLs:

MANPATH, PKG_CONFIG_PATH, XDG_DATA_DIRS

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @hpk42

Merged in ddriddle/tox/fix_issue_265 (pull request #168)

Fix issue #265 - Pass LD_LIBRARY_PATH by default

→ <<cset 3ed5dc353a99>>

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @hpk42

Fix issue #265 - Pass LD_LIBRARY_PATH by default

This fix passes the LD_LIBRARY_PATH environment variable by default. This
was done to support RedHat Software Collections.

→ <>

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @hpk42

Merged in ddriddle/tox/fix_issue_265 (pull request #168)

Fix issue #265 - Pass LD_LIBRARY_PATH by default

→ <<cset 3ed5dc353a99>>

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @ddriddle

I have submitted a pull request. See pull request #168

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @ddriddle

I would be happy to. I will try to have that done by tomorrow.

@pytoxbot

This comment has been minimized.

pytoxbot commented Sep 17, 2016

Original comment by @hpk42

thanks for the explanations. could you do a little PR to add LD_LIBRARY_PATH and amend the existing test?

@pytoxbot pytoxbot closed this Sep 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment