search

Home  >  Q&A  >  body text

python3.x - Python3 中导入sqlite3模块报错,显示没有模块?

在Centos 7 上安装了 Python3.6,安装后使用sqlite3, 导入sqlite3时报错,显示没有这个模块,请教一下这个一般怎么安装比较方便? sqlite3模块是否要单独安装?

迷茫迷茫2872 days ago688

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-18 10:27:10

    It is recommended to recompile and install again
    But it is recommended to do the following checks first

    1. There is the sqlite3 tool when checking

    2. It is recommended to recompile python3.6 and do the make test operation (if an error is reported during this period, there must be something wrong)

    3. Check whether the folder path in the sqlite_inc_paths list in line 1130 of the source code setup.py file contains two header files including sqlite3.h and sqlite3ext.h.

    I just stepped on this pit before.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-18 10:27:10

    sqlite3 comes with it, your file name will not be sqlite3.py吧,因为python导入模块的顺序为sys.path, it will overwrite the default module

    reply
    0
  • Cancelreply