Ich habe Python3.6 auf ubuntu16.04 installiert und sqlite3 installiert. Wenn ich in Python2 bin, kann ich sqlite erfolgreich importieren, aber in Python3 habe ich einen Importfehler bekommen. Ich habe viele Methoden von Google ausprobiert, aber es funktioniert immer noch nicht. Ich möchte wissen, wie ich es lösen kann.python3.6 import sqlite3 error
Python 3.6.0 (default, Mar 13 2017, 06:38:19)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
> import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
Wie genau haben Sie installieren Python 3? Wie genau haben Sie das SQLite-Modul installiert? –
Ich kompilierte den Quellcode zu installiertem Python 3. und installierte sqlite mit "sudo apt-get install sqlite3" – dragon
Ich empfehle, dass anstatt die Quelle selbst zu kompilieren, Sie es von einem vorgefertigten Paket installieren. Anleitung hier: http://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get –