我无法在 NVIDIA Jetson AGX Xavier 上正确安装 MariaDB Connecter/C 和 mariadb python 包并与之合作。显然,这些.so
文件最终位于 python 包找不到它的位置。我该如何纠正?这是我目前正在采取的步骤...
- 从这里下载并解压源 tarball 。
- 构建和安装 MariaDB 连接器/C
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local
make
sudo make install
这会将库文件安装在/usr/local/lib/mariadb
.
gatekeeper@gatekeeper-agx02:/usr/local/lib/mariadb$ ls
libmariadbclient.a libmariadb.so libmariadb.so.3 plugin
- 安装python包
pip install mariadb
然后,当我启动 python 并尝试导入 mariadb 包时,我收到此错误:
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
如何更改库安装目录(以及路径名?)或将 python 包指向正确的位置?