No module named sqlite
source link: https://www.codesd.com/item/no-module-named-sqlite.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
No module named sqlite
i am a beginner i need to create a python virtual_environment for installing Django. I am using the following steps for installing python and virtualenv
cd /usr/src/
wget http://www.python.org/ftp/python/3.5.1./Python-3.5.1.tgz
tar zxf Python-3.5.1.tgz
cd python-3.5.1
mkdir /usr/local/python-3.5
./configure --prefix=/usr/local/python'.$python.' --with-threads --enable-shared --with-zlib=/usr/include && make && make altinstall
echo "/usr/local/python3.5/lib" > python3.5.conf
mv python3.5.conf /etc/ld.so.conf.d/python3.5.conf
/sbin/ldconfig
ln -sfn /usr/local/python3.5/bin/python3.5 /usr/bin/python3.5
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-11.3.1.tar.gz
tar xzf setuptools-11.3.1.tar.gz
cd setuptools-11.3.1
/usr/local/python3.5/bin/python3.5 setup.py install
/usr/local/python3.5/bin/easy_install-3.5 pip
ln -sfn /usr/local/python3.5/bin/pip3.5 /usr/bin/pip3.5
/usr/local/python3.5/bin/pip3.5 install virtualenv
then i am created a virtualenv based on this, and enter into python shell and use
import sqlite
i got following error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'sqlite'
And i tried to run a django project installed in the virtalenv i got following errors.
raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named '_sqlite3'
I am using CentOS release 6.8 (Final).
The python-bundled sqlite package is called sqlite3
: https://docs.python.org/3.6/library/sqlite3.html
So, just do
import sqlite3
and you should be good.
EDIT
I only now realized that you're building python yourself. So that's probably why the sqlite3 module is missing. Check the output of the configure call whether sqlite3 is mentioned. I assume you'd have to get the development packages.
Recommend
-
89
Red Hat named to inaugural Fortune Future 50 list...
-
13
MacOSX问题:ImportError: No module named ‘_scproxy’ 作者: xusx 分类: Python 发...
-
13
ImportError: No module named numpy - Google Cloud Dataproc when using Jupyter Notebook advertisements When starting Jupyter Notebook on Google...
-
3
ItsMyCode | In Python, if you try to import Requestswithout installing the module using pip, you will get no module named requests error. In this tutorial, let’s look at installing the Requ...
-
3
ItsMyCode | In Python, if you try to import _pandas_without installing the module using pip, you will get no module named pandas error. In this tutorial, let’s look at installing the _pandas_module c...
-
7
V2EX › Node.js sqlite 编译需要 NODE_MODULE_VERSION 76,但是找不到对应 node 版本
-
5
SQLite B-Tree Module Table Of Contents 1 Document Overview 1.1 Scope and Purpose This document provides a description of the functionality of and public interface offe...
-
7
python代码报错No module named numpy问题 精选 原创 1 一般在“控制面板+cmd”中...
-
3
Member
-
2
chmod 755The requested module does not provide an export namedOctober 05, 2023I've been working on a project using
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK