Python3.5 use Sqlite3, python3.5sqlite3

Source: Internet
Author: User

Python3.5 use Sqlite3, python3.5sqlite3

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

Xiu Yuxuan Chen @ cnblog

Python3.5 use Sqlite3

Many optional parameters are provided during python3.5 installation. These parameters are not provided by default. However, when we want to install pip install and esay_install, we find that they cannot be installed. In this case, we can only reinstall python. and add optional parameters during compilation,

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

1 install Sqlite3 1.1 download SQLTLE3:

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

1.2 install SQLITE 3

Decompress the package and go to the sqlite3 directory.

Compile:

$ Configure-prefix = <your installation path >### here I set/usr/local/sqlite

$ Make-j4

$ Sudo make install

After the installation is successful, 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 python3 2.1 and add the Sqlite3 search path.

Edit setup. py in python3.5.X as follows (add the sqlite search path ):

Run vim setup. py and enter the following command in command mode:

/Sqlite_inc_paths # used to find this field ,:

In this sentence, add the sqlite path you just installed. Because I installed it in/usr/local/sqlite3, I will add:

/Usr/local/sqlite3/include

/Usr/local/sqlite3/include/sqlite3

:

2.2 install python

./Configure -- enable-loadable-sqlite-extensions # Set the option

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

In other words, we can open all the Optional options of python.

In the Python installation directory, run the following two commands:

$ Make-j4 # compile python. If the number of CPU cores on your machine is large enough, add the number after-j;

$ Sudo make install # install the compiled python

3. Verification

To verify whether python is successfully installed, you can find _ sqlite *. so in the/directory.

Find/-name _ sqlite *. so

Continue Verification:

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.