Skip to content

Commit 01dceed

Browse files
authored
ARROW-104 Improve Error Message for Lib ImportError (#84)
1 parent 405d97a commit 01dceed

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bindings/python/pymongoarrow/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import traceback
1516
import warnings
1617

1718
# We must import pyarrow before attempting to load the Cython module.
@@ -30,7 +31,11 @@ def _parse_version(version):
3031
try:
3132
from pymongoarrow.lib import libbson_version
3233
except ImportError:
33-
warnings.warn("This library has not been compiled")
34+
warnings.warn(
35+
"Could not find compiled pymongoarrow.lib extension, please install "
36+
"from source or report the following traceback on the issue tracker:\n"
37+
f"{traceback.format_exc()}"
38+
)
3439
libbson_version = None
3540

3641
if libbson_version is not None:

0 commit comments

Comments
 (0)