Cannot find -lsqlite3 when making python 3、sqlite3模块不工作
Cannot find -lsqlite3 when making python 3, sqlite3 module doesn't work
我正在尝试在 RHEL7 上安装 python,这需要从源代码制作 python。尝试这样做时,我 运行 遇到了这个错误
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: skipping incompatible //lib/libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: skipping incompatible //usr/lib/libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
warning: building with the bundled copy of libffi is deprecated on this platform. It will not be distributed with Python 3.7
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_lzma _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time
Failed to build these modules:
_sqlite3
running build_scripts
当我尝试 make
时。
当我查看这些路径时,这是我发现的,我还安装了 sqlite3:
[brad@reason Downloads]$ ls /usr/lib/gcc | grep sql
[brad@reason Downloads]$ ls /lib | grep sql
libodbcpsqlS.so
libodbcpsqlS.so.2
libodbcpsqlS.so.2.0.0
libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.8.6
[brad@reason Downloads]$ ls /usr/lib | grep sql
libodbcpsqlS.so
libodbcpsqlS.so.2
libodbcpsqlS.so.2.0.0
libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.8.6
[brad@reason Downloads]$ sqlite3
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
我不确定我做错了什么。显然没有 lsqlite3.so
库文件,但我不确定从哪里得到它。我读到我需要为 RHEL 安装 sqlite-devel
,但是当我尝试这样做时,似乎缺少所需的回购协议。我认为我的雇主更改了回购清单。我如何查看是否已安装?我尝试从 RPM 安装它,但我认为它失败了(需要一长串依赖项)。
[root@reason Downloads]# yum install -y sqlite sqlite-devel
Loaded plugins: downloadkvmonly-background, ibm-check-lotus-updates, ibm-check-upgrade, ibm-check-xorg-updates, ibm-repository, langpacks, post-transaction-actions, refresh-packagekit, versionlock
Cannot reach IBM Intranet network. Please ensure you have an active IBM connection.
http://people.centos.org/tru/devtools-2/7Workstation/x86_64/RPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
One of the configured repositories failed (testing 2 devtools for CentOS 7Workstation),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=testing-devtools-2-centos-7Workstation ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable testing-devtools-2-centos-7Workstation
or
subscription-manager repos --disable=testing-devtools-2-centos-7Workstation
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=testing-devtools-2-centos-7Workstation.skip_if_unavailable=true
failure: repodata/repomd.xml from testing-devtools-2-centos-7Workstation: [Errno 256] No more mirrors to try.
http://people.centos.org/tru/devtools-2/7Workstation/x86_64/RPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
我希望能够构建 python 并构建 _sqlite3
模块。当前 _sqlite3
构建失败,导致 import sqlite3
无法在 python 中正常工作,但它应该如此。我考虑过只在 docker 容器中安装 python,但我认为这不能完全满足我的需要。
@some-programmer-dude 是正确的。我的 sqlite3 安装是 32 位版本。我刚刚下载了源代码,构建它,制作并安装。现在我不再缺少 _sqlite3
库了。我错误地使用了来自 the download page 的预编译 linux 二进制文件,因为它们只预编译了 32 位版本。我应该从一开始就构建它。谢谢一些程序员。
我正在尝试在 RHEL7 上安装 python,这需要从源代码制作 python。尝试这样做时,我 运行 遇到了这个错误
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: skipping incompatible //lib/libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: skipping incompatible //usr/lib/libsqlite3.so when searching for -lsqlite3
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
warning: building with the bundled copy of libffi is deprecated on this platform. It will not be distributed with Python 3.7
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_lzma _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexit pwd time
Failed to build these modules:
_sqlite3
running build_scripts
当我尝试 make
时。
当我查看这些路径时,这是我发现的,我还安装了 sqlite3:
[brad@reason Downloads]$ ls /usr/lib/gcc | grep sql
[brad@reason Downloads]$ ls /lib | grep sql
libodbcpsqlS.so
libodbcpsqlS.so.2
libodbcpsqlS.so.2.0.0
libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.8.6
[brad@reason Downloads]$ ls /usr/lib | grep sql
libodbcpsqlS.so
libodbcpsqlS.so.2
libodbcpsqlS.so.2.0.0
libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.8.6
[brad@reason Downloads]$ sqlite3
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
我不确定我做错了什么。显然没有 lsqlite3.so
库文件,但我不确定从哪里得到它。我读到我需要为 RHEL 安装 sqlite-devel
,但是当我尝试这样做时,似乎缺少所需的回购协议。我认为我的雇主更改了回购清单。我如何查看是否已安装?我尝试从 RPM 安装它,但我认为它失败了(需要一长串依赖项)。
[root@reason Downloads]# yum install -y sqlite sqlite-devel
Loaded plugins: downloadkvmonly-background, ibm-check-lotus-updates, ibm-check-upgrade, ibm-check-xorg-updates, ibm-repository, langpacks, post-transaction-actions, refresh-packagekit, versionlock
Cannot reach IBM Intranet network. Please ensure you have an active IBM connection.
http://people.centos.org/tru/devtools-2/7Workstation/x86_64/RPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
One of the configured repositories failed (testing 2 devtools for CentOS 7Workstation),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=testing-devtools-2-centos-7Workstation ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable testing-devtools-2-centos-7Workstation
or
subscription-manager repos --disable=testing-devtools-2-centos-7Workstation
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=testing-devtools-2-centos-7Workstation.skip_if_unavailable=true
failure: repodata/repomd.xml from testing-devtools-2-centos-7Workstation: [Errno 256] No more mirrors to try.
http://people.centos.org/tru/devtools-2/7Workstation/x86_64/RPMS/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
我希望能够构建 python 并构建 _sqlite3
模块。当前 _sqlite3
构建失败,导致 import sqlite3
无法在 python 中正常工作,但它应该如此。我考虑过只在 docker 容器中安装 python,但我认为这不能完全满足我的需要。
@some-programmer-dude 是正确的。我的 sqlite3 安装是 32 位版本。我刚刚下载了源代码,构建它,制作并安装。现在我不再缺少 _sqlite3
库了。我错误地使用了来自 the download page 的预编译 linux 二进制文件,因为它们只预编译了 32 位版本。我应该从一开始就构建它。谢谢一些程序员。