没有名为pysqlite2._sqlite的模块错误与瓶 [英] No module named pysqlite2._sqlite Error with flask

查看:337
本文介绍了没有名为pysqlite2._sqlite的模块错误与瓶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我有一个问题,没有模块名为pysqlite2._sqlite错误
$ b $我使用SQLalchemy与烧瓶和virtualenv



当我按照这种模式查询

  user = User.query.filter_by(social_id = social_id).first ()

我得到以下错误:

<$第一个错误是

没有模块名为pysqlite2._sqlite

p>

 没有名为pysqlite2的模块

所以我安装pysqlite pip安装pysqlite



我尝试重新安装pysqlite

  pip uninsatll pysqlite 
pip install pysqlite

但是

然后我检查sqlahcemy代码,它是这样的导入模块


$ p

from pysqlite2 import dbapi2

但是在控制台



来自pysqlite2 i mport dbapi2



正在工作。

所以我检查了pysqlite2库文件夹

我发现有_sqlite.so文件。



有什么问题?

解决方案

我发现这个问题

引擎环境

Google应用引擎不提供c编译的库。

sqlite有c complied文件,所以它不能导入模块

Hi I m have a problem with No module named pysqlite2._sqlite error

I m using SQLalchemy with flask and virtualenv

when i query by model like this

user  = User.query.filter_by(social_id = social_id).first()

i got the following error

No module named pysqlite2._sqlite

First error was

No module named pysqlite2

So i install the pysqlite by pip install pysqlite

I try to reinstall the pysqlite by

pip uninsatll pysqlite
pip install pysqlite

But the same problem is ouccuring

And i check the sqlahcemy code, it import module like this

from pysqlite2 import dbapi2 

But at the console

from pysqlite2 import dbapi2

is working.

So i check the pysqlite2 library folder

I found that there is _sqlite.so file.

What is the problem?

解决方案

I find the problem

Error occur from the google app engine environment

Google app engine doesn't provide c compiled library.

sqlite has c complied file, so it can't import module

这篇关于没有名为pysqlite2._sqlite的模块错误与瓶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆