mattroos
mattroos

Reputation: 135

How to properly install MariaDB Connector/C and mariadb python package on NVIDIA Jetson?

I'm failing to get MariaDB Connecter/C and the mariadb python package properly installed and cooperating on an NVIDIA Jetson AGX Xavier. Apparently the .so files ends up in a location where the python package cannot find it. How can I correct this? Here are the steps I'm currently taking...

  1. Download and untar the source tarball from here.
  2. Build and install MariaDB Connector/C
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
make
sudo make install

This installs the library files in /usr/local/lib/mariadb.

gatekeeper@gatekeeper-agx02:/usr/local/lib/mariadb$ ls
libmariadbclient.a  libmariadb.so  libmariadb.so.3  plugin
  1. Install the python package
pip install mariadb

Then, when I start python and try to import the mariadb package I get this error:

gatekeeper@gatekeeper-agx02:~$ python
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mariadb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/gatekeeper/.local/lib/python3.6/site-packages/mariadb/__init__.py", line 10, in <module>
    from ._mariadb import (
ImportError: libmariadb.so.3: cannot open shared object file: No such file or directory

How can I change the library installation directory (and to what path name?) or point the python package the correct location?

Upvotes: 2

Views: 849

Answers (1)

wickedchicken
wickedchicken

Reputation: 4773

I was unable to get it to work via cmake options, but doing the following (hacky) solution worked:

cd /usr/local/lib; sudo cp -r mariadb/* ./

This just copies everything in /usr/local/lib/mariadb/* into /usr/local/lib.

Upvotes: 1

Related Questions