5

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.

2 Answers 2

8
  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

7

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

2
  • much obliged. SO tells me I need to wait 7 minutes to accept this, will do then.
    – Max Power
    Jun 19, 2017 at 3:39
  • 1
    @MaxPower I'm new to StackOverflow. When you wrote SO. I was thinking why your significant other told you to wait 7 minutes :-D.
    – Ganesh
    Jun 19, 2017 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.