小编Nic*_*ris的帖子

在Heroku上用Python2.7导入sqlite3

我正在用Python尝试Heroku,我成功地使用Flask运行了"hello word"示例.

我现在想要部署一个非常基本的应用程序,使用sqlite3和Flask,我知道应用程序正在运行.但我无法让它工作,我怀疑问题是sqlite.

当我启动Heroku提供的Python shell时,这里是导入错误日志:

$ heroku run python     
Running python attached to terminal... up, run.2
Python 2.7.1 (r271:86832, Jun 26 2011, 01:08:11) 
[GCC 4.4.3] on linux2
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/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3
>>> …
Run Code Online (Sandbox Code Playgroud)

python sqlite heroku

6
推荐指数
1
解决办法
1139
查看次数

标签 统计

heroku ×1

python ×1

sqlite ×1