Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在我的Ubuntu(Ubuntu 18.04.3 LTS/bionic)上设置Yocto时出错;ImportError:没有名为'_sqlite3'&引用;_Sqlite_Yocto_Ubuntu 18.04_Bitbake - Fatal编程技术网

在我的Ubuntu(Ubuntu 18.04.3 LTS/bionic)上设置Yocto时出错;ImportError:没有名为'_sqlite3'&引用;

在我的Ubuntu(Ubuntu 18.04.3 LTS/bionic)上设置Yocto时出错;ImportError:没有名为'_sqlite3'&引用;,sqlite,yocto,ubuntu-18.04,bitbake,Sqlite,Yocto,Ubuntu 18.04,Bitbake,我的第一篇关于设置Yocto开发环境的帖子 在我的Ubuntu系统(Ubuntu18.04.3 LTS/bionic)上,基于 此web链接为() 一切都很好,直到~/poky/build$bitbake核心图像sato 导致此错误的原因: 文件“/usr/local/lib/python3.5/sqlite3/dbapi2.py”,第27行,在 从_sqlite3导入* ImportError:没有名为“\u sqlite3”的模块 下面是我克服这个错误的努力,这个错误没有解决问题 上面的错误

我的第一篇关于设置Yocto开发环境的帖子 在我的Ubuntu系统(Ubuntu18.04.3 LTS/bionic)上,基于 此web链接为()

一切都很好,直到~/poky/build$bitbake核心图像sato
导致此错误的原因:
文件“/usr/local/lib/python3.5/sqlite3/dbapi2.py”,第27行,在
从_sqlite3导入*
ImportError:没有名为“\u sqlite3”的模块
下面是我克服这个错误的努力,这个错误没有解决问题
上面的错误。请慷慨一点,并提供一些指导。我寻找
有关投寄地点;;任何关于更好地方的建议都将不胜感激。
非常感谢。
------------------------------------------------
对此错误()进行web搜索会导致:
如何在Ubuntu | Chron.com中使用SQLite
具有
~/poky/build$sudo apt get安装sqlite3 libsqlite3 dev
这告诉我:
正在阅读软件包列表。。。多恩
构建依赖树
正在读取状态信息。。。多恩
libsqlite3-dev已经是最新版本(3.22.0-1ubuntu0.1)。
sqlite3已经是最新版本(3.22.0-1ubuntu0.1)。
以下软件包已自动安装,不再使用
必修的:
linux-headers-5.0.0-23 linux-headers-5.0.0-23-generic linux-image-5.0.0-23-generic linux-modules-5.0.0-23-generic
linux-modules-extra-5.0.0-23-generic
使用“sudo apt autoremove”删除它们。
0已升级,0已新安装,0已删除,12未升级。
因此,显然sqlite3存在于我的系统中。以下是我检查过的SO参考资料:
[导入错误:python3.3中没有名为'\u sqlite3'的模块][1]
[没有名为“\u sqlite3”python3.4”的模块][2]
[导入错误:没有名为_sqlite3的模块(即使在做了所有事情之后)][3]
[导入错误:没有名为_sqlite3][4]的模块]
[1]: https://stackoverflow.com/questions/20126475/importerror-no-module-named-sqlite3-in-python3-3
[2]: https://stackoverflow.com/questions/24052137/importerror-no-module-named-sqlite3-python3-4
[3]: https://stackoverflow.com/questions/35889383/importerror-no-module-named-sqlite3-even-after-doing-eveything
[4]: https://stackoverflow.com/questions/2665337/importerror-no-module-named-sqlite3

我刚刚启动了一个构建,在一个全新的Ubuntu 18.04安装上逐字验证了简短的快速启动步骤。甚至根本没有安装SQLite,但是构建过程进行得很顺利。因此,开发主机中的python安装以某种方式被破坏的可能性非常高。然而,可能有以下原因:

  • 您可能明确选择了Python3.5,因为您所做的其他事情需要它
  • 您可能隐式地选择了Python3.5,因为您从旧安装中转发了一些东西,安装了一些依赖于它的东西,或者类似的东西
无论如何,我猜现在修补链接可能会破坏你机器上其他地方的东西,这应该避免

那么你现在有什么选择?我的建议是开始在容器中构建,最简单的方法是安装docker并启动docker运行(它是ubuntu:bionic/bin/bash),至少要验证事情是否正常运行

从长远来看,您可能希望为此制作一个专门的容器,并添加一个或两个:

1) 是否已经设置了所有需要的包 2) 使用标准用户而不是根用户


这是我个人做事的方式。另一种选择是使用准备好的东西,因为这是一个已知的好的解决方案,它可以显著减少由主机系统的特殊性引起的问题。

根据NXP semiconductor人员的说法,Ubuntu_18.04需要Python3.6;然后我可以安装sqlite3。我的系统在不同的目录中安装了Python3.5和Python3.6;可能是什么让bitbake/Yocto感到困惑。检查我的Ubuntu_18.04系统,我发现…Python3.6安装在/usr/bin/as中。。。lrwxrwx python3->python3.6-rwxr-xr-x python3.6哪个python3指向/usr/local/bin/as中的3.5版本。。。lrwxrwx python3->python3.5-rwxr-xr-x python3.5指向3.5 in/usr/local/bin/的符号链接取代指向3.6 in/usr/bin/的符号链接。删除3.5?安装的python3.5的链接,因为在最新版本被广泛安全使用之前,我会尽量保留一个版本。我只为Spyder使用3.5。这是一个全新的Ubuntu安装,除此之外。我会试试你的“码头工人”建议;尽管如此,如果我删除了Python3.5符号链接,我仍然无法重新启动。
All is well until... ~/poky/build$ bitbake core-image-sato

which results in this error:

File "/usr/local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'

Below is my effort to proceed past this error, which didn't resolve the 
error above.  Please be generous and provide some guidance.  I searched for 
relevant posting locations; any advice on a better place is appreciated.    

Thank you.

------------------------------------------------

A web search on this error () results in:
How to Use SQLite in Ubuntu | Chron.com 
with

~/poky/build$ sudo apt-get install sqlite3 libsqlite3-dev

which tells me this:

Reading package lists... Done
Building dependency tree 
Reading state information... Done
libsqlite3-dev is already the newest version (3.22.0-1ubuntu0.1).
sqlite3 is already the newest version (3.22.0-1ubuntu0.1).
The following packages were automatically installed and are no longer 
required:
linux-headers-5.0.0-23 linux-headers-5.0.0-23-generic linux-image-5.0.0-23-generic linux-modules-5.0.0-23-generic
linux-modules-extra-5.0.0-23-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

So, evidently sqlite3 exists on my system.  Here are the SO references that I checked:

[ImportError: No module named '_sqlite3' in python3.3][1]
[importerror no module named '_sqlite3' python3.4][2]
[ImportError: No module named _sqlite3 (even after doing eveything)][3]
[ImportError: No module named _sqlite3][4]


[1]: https://stackoverflow.com/questions/20126475/importerror-no-module-named-sqlite3-in-python3-3
[2]: https://stackoverflow.com/questions/24052137/importerror-no-module-named-sqlite3-python3-4
[3]: https://stackoverflow.com/questions/35889383/importerror-no-module-named-sqlite3-even-after-doing-eveything
[4]: https://stackoverflow.com/questions/2665337/importerror-no-module-named-sqlite3