简体   繁体   中英

ImportError: No module named _sqlite3 (even after doing eveything)

i am using python 2.7.11 on virtualenv in lubuntu 12.04.(dont own a good laptop its dell latitude d600)

Python 2.7.11 (default, Mar  4 2016, 04:38:41) 

[GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import sqlite3 Traceback (most recent call last): File "", line 1, in File "/home/maharshi/.localpython/lib/python2.7/sqlite3/ init .py", line 24, in from dbapi2 import * File "/home/maharshi/.localpython/lib/python2.7/sqlite3/dbapi2.py", line 28, in from _sqlite3 import * ImportError: No module named _sqlite3

i have installed pysqlite using pip and it says successfull.

(p2.7) maharshi@maharshi-Latitude-D600:~/code$ which python
/home/maharshi/virtualenvs/p2.7/bin/python
(p2.7) maharshi@maharshi-Latitude-D600:~/code$ which pip
/home/maharshi/virtualenvs/p2.7/bin/pip
(p2.7) maharshi@maharshi-Latitude-D600:~/code$ pip install pysqlite
Requirement already satisfied (use --upgrade to upgrade): pysqlite in /home/maharshi/virtualenvs/p2.7/lib/python2.7/site-packages

i also installed it manually at both locations ie

~/virtualenvs/p2.7/
~/.localpython/ (from where i created the virtualenv)

i also installed " libsqlite3-dev (as suggested by one of the posts)" ie

sudo apt-get install libsqlite3-dev

Thank you in advance.

再次尝试在 virtualenv 中安装 python 的整个过程...据我了解,当您添加 SqlLite 所需的库时,它不会影响 virtualenv python,因此您必须重新执行所有步骤,它将使用所需的库进行编译.. ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM