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).