Python3.5 using Sqlite3

Source: Internet
Author: User
Tags sqlite

python3.5 installation will have a lot of optional parameters, these parameters are not provided by default, but when we want to install through the PIP, Esay_install can not be installed, in this case, We can only install Python from the new. and add to the optional parameters when compiling,

------------------------

1 Installing Sqlite31.1 Download SQLTLE3:

Https://www.sqlite.org/download.html

1.2 Installing SQLite 3

After decompression into the Sqlite3 directory

To compile:

$configure –prefix=< Your installation path > # # #这里我设置的是/usr/local/sqlite

$make –j4

$sudo make Install

After successful installation, the following information is output:

/usr/bin/mkdir-p '/usr/local/sqlite/bin '

/bin/sh./libtool--mode=install/usr/bin/install-c sqlite3 '/usr/local/sqlite/bin '

Libtool:install:/usr/bin/install-c sqlite3/usr/local/sqlite/bin/sqlite3

/usr/bin/mkdir-p '/usr/local/sqlite/include '

/usr/bin/install-c-M 644 sqlite3.h sqlite3ext.h '/usr/local/sqlite/include '

/usr/bin/mkdir-p '/usr/local/sqlite/share/man/man1 '

/usr/bin/install-c-M 644 sqlite3.1 '/usr/local/sqlite/share/man/man1 '

/usr/bin/mkdir-p '/usr/local/sqlite/lib/pkgconfig '

/usr/bin/install-c-M 644 sqlite3.pc '/usr/local/sqlite/lib/pkgconfig '

MAKE[1]: Leaving directory '/root/workspace/sqlite-autoconf-3170000 '

2 Reinstall python32.1 Add Sqlite3 search Path

Edit python3.5.x inside the setup.py, content as follows (add SQLite search Path):

Open with Vim setup.py and enter in command mode:

/sqlite_inc_paths #用于寻找该字段,:

Add the SQLite path you just installed in this sentence, because I was installed under/usr/local/sqlite3, so I will add:

/usr/local/sqlite3/include

/usr/local/sqlite3/include/sqlite3

2.2 Installing Python

./configure--enable-loadable-sqlite-extensions # # Settings options available

PS: After executing the command, the final output is found:

In fact, when we open all the optional options for Python, in other words we can open all the optional options for Python.

In the Python installation directory, use a few two commands:

$make –j4 # #这句话是对python compile, if the CPU on your own machine is more than the number of cores, you can appropriately increase the number behind-j;

$sudo make install # # installs the compiled Python

3 Verification

In order to verify that the installation of Python is successful, you can find _sqlite*.so in/directory

Find/-name _sqlite*.so

Continue validation:

Python3.5 using Sqlite3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.