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

LD_LIBRARY_PATH-induced Python import errors: Shorten error message #213

Closed
tswilliams opened this issue Sep 17, 2020 · 0 comments
Closed

Comments

@tswilliams
Copy link
Collaborator

If the uHAL Python module cannot be imported due to LD_LIBRARY_PATH missing relevant paths (e.g. /opt/cactus/lib for a standard install), then right now the following message will be printed

ImportError: libcactus_uhal_tests.so.2.7: cannot open shared object file: No such file or directory
N.B. ImportError (or derived exception) raised when uHAL's __init__.py tries to load python bindings library
     Maybe you need to add "/opt/cactus/lib", or some other path, to the "LD_LIBRARY_PATH" environment variable?

On reflection, this is a bit too verbose and should be shortened to something like:

ImportError: Could not load uHAL Python bindings (typical cause: paths missing from LD_LIBRARY_PATH). Details: "libcactus_uhal_tests.so.2.7: cannot open shared object file: No such file or directory"

Also: We should update gen_ipbus_addr_decode to make sure its output in this scenario is more concise & user-friendly. Current output:

--(serenity_ku15p_so1)--> /opt/cactus/bin/uhal/tools/gen_ipbus_addr_decode aaa
Traceback (most recent call last):
  File "/opt/cactus/bin/uhal/tools/gen_ipbus_addr_decode", line 22, in <module>
    import uhal
  File "/usr/lib/python2.7/site-packages/uhal/__init__.py", line 14, in <module>
    exec('raise type(e), type(e)(e.message + msg_suffix), sys.exc_info()[2]')
  File "/usr/lib/python2.7/site-packages/uhal/__init__.py", line 5, in <module>
    from ._core import *
ImportError: libcactus_uhal_tests.so.2.7: cannot open shared object file: No such file or directory
N.B. ImportError (or derived exception) raised when uHAL's __init__.py tries to load python bindings library
     Maybe you need to add "/opt/cactus/lib", or some other path, to the "LD_LIBRARY_PATH" environment variable?
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

1 participant