Skip to content

Improve error message when failing to load gmt library #792

@seisman

Description

@seisman

Description of the problem

See this post for context.

When PyGMT fails to load the GMT library, it doesn't provide useful information so it's unclear what causes the failure.

Actually, ctypes.CDLL provides some useful information, for example:

import ctypes
ctypes.CDLL("/path/to/libgmt.so")

gives me more information:

OSError                                   Traceback (most recent call last)
<ipython-input-8-7c08c5dbc028> in <module>()
----> 1 CDLL("/usr/local/lib/libgmt.so")

/usr/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/././libtiledb.so.2.1)

We should let PyGMT output these messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproving an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions