Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.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
Python 2.7 Python 3.6:没有名为'_sqlite3';_Python 2.7_Python 3.x_Ubuntu 16.04 - Fatal编程技术网

Python 2.7 Python 3.6:没有名为'_sqlite3';

Python 2.7 Python 3.6:没有名为'_sqlite3';,python-2.7,python-3.x,ubuntu-16.04,Python 2.7,Python 3.x,Ubuntu 16.04,我有两个版本的python在Ubuntu 16.02上运行2.7和3.6 使用Python2.7,以下代码将成功运行 # will compile successfully import sqlite3 但是当使用Python3.7时,下面的代码将抛出-没有名为_sqlite3error的模块 # will throw no module error import sqlite3 这个问题有什么解决办法吗? 您是如何安装Python 3.6的?安装libsqlite3 dev头文件后,需要重

我有两个版本的python在Ubuntu 16.02上运行2.7和3.6

使用Python2.7,以下代码将成功运行

# will compile successfully
import sqlite3
但是当使用Python3.7时,下面的代码将抛出-没有名为_sqlite3error的模块

# will throw no module error
import sqlite3
这个问题有什么解决办法吗?

您是如何安装Python 3.6的?安装libsqlite3 dev头文件后,需要重新编译扩展模块。谢谢@MartijnPieters:)