Python ist3.6 import sqlite3 Fehler

Installierte ich die Python ist3.6 auf ubuntu16.04 und sqlite3 installiert. Wenn in python2 ist, kann ich import sqlite erfolgreich, aber in Python ist3 bekam ich eine import-Fehler. Ich habe versucht, viele Methoden, die von Google, aber es funktioniert immer noch nicht. Ich will wissen, wie es zu lösen.

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 hast du das installieren von Python 3? Wie genau haben Sie das SQLite-Modul?
  • Ich kompiliert den source-code installiert Pythhon 3。und sqlite installiert mit "sudo apt-get install sqlite3"
  • Ich empfehle, dass, anstatt das kompilieren der Quelle selbst ist, installieren Sie es von einem pre-built-Paket. Anleitung hier: askubuntu.com/questions/865554/...
  • danke, es ist hilfreich
InformationsquelleAutor dragon | 2017-03-13
Schreibe einen Kommentar