Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Figuring out my sqlite version

I wanted to check which version of sqlite I had, which has become way more confusing than I expected. To start fresh, I created a new conda environment with:

conda create --name my_env_name python=3.6 sqlite hdf5 pandas

The shell message said it would install sqlite: 3.13.0-1 in the new environment, along with a few other packages.

Then, after activating that new conda environment, I immediately ran pip freeze, but the list of packages I see does not include any entry for sqlite.

Finally, I just enter python from the terminal (in this conda env) to enter a system python in my shell. The opening message says python version 3.6.1, confirming I'm in that newly created environment. But then

import sqlite3
sqlite3.version

outputs '2.6.0'

What's going on? Do I have sqlite3 version 3.13 installed or 2.6? If my sqlite3 version is 2.6, how do I get something newer? That would be pretty old.

like image 957
Max Power Avatar asked Jun 19 '17 03:06

Max Power


People also ask

What is version in SQLite?

Version 2. April 6, 2022. androidx. sqlite:sqlite:2.3. 0-alpha02 , androidx. sqlite:sqlite-framework:2.3.

What is my SQLite?

SQLite is self-contained means it requires minimal support from the operating system or external library. This makes SQLite usable in any environment especially in embedded devices like iPhones, Android phones, game consoles, handheld media players, etc. SQLite is developed using ANSI-C.

How do I know what version of SQLite I have Mac?

Check for SQLite The first thing to do is to check whether SQLite is installed on your system or not. You can do this simply by entering sqlite3 into your system's command line interface (assuming version 3+ is installed). For example, on a Mac, open the Terminal and enter sqlite3 .


2 Answers

  1. Import sqlite3 into your python script:

    import sqlite3
    
  2. Add the following lines to your script:

    print "SQLite Version is:", sqlite3.sqlite_version
    print "DB-API Version is:", sqlite3.version
    
  3. Running the script produced the following results for me (your results may differ):

    SQLite Version is: 3.11.0
    DB-API Version is: 2.6.0 
    

This information is documented in The Python Standard Library, "Section 12.6.1. Module functions and constants" https://docs.python.org/3/library/sqlite3.html

like image 114
Frank R Avatar answered Sep 26 '22 14:09

Frank R


Yes, you have installed the sqlite: 3.13.0-1 version of sqlite database. If you want to check, run sqlite3 --version

import sqlite3
sqlite3.version

Here you get version for DB-API 2.0 interface for SQLite which is 2.6.0

like image 32
Ganesh Avatar answered Sep 23 '22 14:09

Ganesh