Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

楼主好,部署时遇见了问题pysqlite2找不到 #1

Closed
cowthan opened this issue Mar 2, 2017 · 1 comment
Closed

楼主好,部署时遇见了问题pysqlite2找不到 #1

cowthan opened this issue Mar 2, 2017 · 1 comment

Comments

@cowthan
Copy link

cowthan commented Mar 2, 2017

File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 334, in dbapi
from pysqlite2 import dbapi2 as sqlite
ModuleNotFoundError: No module named 'pysqlite2'
我查了一下,说是:
The module is called sqlite3. pysqlite2 was the module's name before it became part of the Python standard library.

You probably want to use this in your code:

import sqlite3
And the standard documentation is here: http://docs.python.org/library/sqlite3.html

edit: And just to cover all the bases:

The sqlite3 module also has a dbapi2 sub-member, but you don't need to use it directly. The sqlite3 module exposes all the dbapi2 members directly.

本人不是搞python开发,不太明白,我的python环境是linux 3.6.0

@skytoup
Copy link
Owner

skytoup commented Mar 15, 2017

@cowthan 今天有空尝试了在Ubuntu16.04下部署,确实存在这样的问题
经过一番尝试,发现是系统没有安装sqlite3相关的东西,解决方案如下:

  1. sudo apt install sqlite3 libsqlite3-dev # 安装sqlite3
  2. 下载python3源码,解压,cd到该目录
  3. ./configure --with-ssl --enable-loadable-sqlite-extensions && make && sudo make install # 重新编译安装

可以尝试import sqlite3,没有报错就可以了

@skytoup skytoup closed this as completed Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants