sqlite3 is not be able to import in python 3

前端 未结 1 1407
渐次进展
渐次进展 2020-12-17 03:38

sqlite is working fine with python 2.7 but when I am trying to import this in python 3 it gives error

> Traceback (most recent call last):   File \"dbCon         


        
相关标签:
1条回答
  • 2020-12-17 04:26

    sqlite3 is an optional part of the standard library. It is compiled when you compile and install Python 3, but only if the right sqlite3 include files (development headers) are available.

    If you compiled and installed Python 3 yourself, install the dependencies (libsqlite3-dev or sqlite-devel or similar, depending on your Linux distribution, for example), then re-compile and re-install Python 3.

    Externally, the library is maintained as pysqlite; but that release doesn't support Python 3. Even then, to install it you'll still need those sqlite development files, and you'd need to port it to Python 3. You may as well just re-compile Python 3.

    0 讨论(0)
提交回复
热议问题