What was the first version of Python that included SQLite?
What version of SQLite was included?
I thought Python 2.5 was the first version to include SQLite, but I was hoping someone could confirm that and the version of SQLite that was first included.
From the docs:
11.13. sqlite3 — DB-API 2.0 interface for SQLite databases
New in version 2.5.
As others have noted, a snapshot of the pysqlite2 was merged into the Python standard library and released as the sqlite3 module in Python 2.5. There has been subsequent independent development on pysqlite2 which has been merged back into sqlite3 at various points for subsequent Python releases and sqlite3 has received its own bug fixes.
There is no one correct answer to the question of which version of SQLite was included because the Python source code distribution does not include the source for SQLite. The build process, for Unix-style builds, depends on an externally provided copy of the library. It is up to each distributor of Python to decide how to manage that. For instance, the current python.org installer 32-bit-only variants for Mac OS X statically includes a version of the SQLite library while the 64-bit variant for 10.6 dynamically links to the system-supplied version of the library. So, to answer your second question, you would need to check each distribution of Python 2.5 and determine what version(s) of SQLite each was statically or dynamically linked with.
It was first included in python version 2.5.
The version of sqlite was 3.0.8, based off of the pysqlite2.1.3 library.
Found here: http://www.python.org/download/releases/2.5/NEWS.txt (search for "sql").
From here, Version 2.5 alpha 1
Related
I have installed python 3.5.3 installed on my Windows machine. I check the SQLite version via the command sqlite3.sqlite_version. It is version 3.8.11.
My question is how can I update the SQLite version to 3.26? I wasn't sure if there was a 3rd party library or if I need to update sqlite3 library.
Thanks.
Just update the sqlite in the system by a newer version. Python will use it. It is not 3rd party. It is included in Python. I am not completely sure but I think it is a dynamically loaded library installed with Python but that you can upgrade by yourself. At least in my system different Python versions report the same sqlite3 version.
I will try to port my Python 2.7 with Django to Python 3. But now my question is what version is the most stable one today? I've heard people use 3.2 and 3.4 and recommend it. But now I'm asking you guys.
What version is the most stable one today?
If you go to their downloads page, you will find the following statement (my emphasis):
We recommend using the latest version of Python 3 [...]
I've been using Python 3.4.3+ in a Django 1.8.2 project without issues and I don't see why you should run into problems here.
However, if you do run into issues, you should file a bug.
What version is the most stable one today?
Whatever version shows up as the recommended download in the python homepage should be considered stable. If that happens to be v3.5, then you should use that.
Python's version are quite stable, but you have to check is virtualenv on your OS is handled already by particular Python's version eg. 3.5.0 is not yet prepared for it. I recommend you 3.4.x, which I use on my own without any problems.
You may check for 'What Python version can I use with Django?' in official documentation here and here faq which lists which Python version is supported to which Django version
pyodbc is a very nice thing, but the Windows installers only work with their very specific python version. With the release of Python 3.4, the only available installers just stop once they don't see 3.3 in the registry (though 3.4 is certainly there).
Copying the .pyd and .egg-info files from a 3.3 installation into the 3.4 site-packages directory doesn't seem to do the trick. When importing pyodbc, an ImportError is thrown: ImportError: DLL load failed: %1 is not a valid Win32 application.
Is there a secret sauce that can be added to make the 3.3 file work correctly? Or do we just need to wait for a 3.4 installer version?
The different versions of Python are (for the most part) not binary-compatible, and thus any compiled extensions (such as pyodbc) will only work for a specific version.
Note that pure-Python packages (the ones that are completely written in Python, and have no non-Python dependencies) do not need to be compiled, and thus can be written to support multiple Python versions.
Also note that it is technically possible for a compiled extension to be written such that it works for Python 3.2 as well as 3.3, 3.4, and the future 3.x's to come, but they have to limit themselves to the "stable ABI" as specified by PEP 384, and most extensions do not do this. As far as I know, pyodbc is not limited to the stable ABI and must be compiled separately for each Python version.
That said, it is also possible to compile your own version of pyodbc from source, as long as you have the required tools and expertise. (But I'm guessing if you're asking this question, you don't. I don't either, otherwise I'd include some tips in this answer.)
As you have already commented, pypyodbc may be your best bet, as it is a pure-Python package.
Installing pypyodbc can be done via the commandline:
C:\Python34\Scripts>pip install pypyodbc
Using it as drop-in replacement of pyodbc can be done using:
import pypyodbc as pyodbc
[The current version of pyodbc at the time of this edit is 3.0.10, and it does support Python 3.4. Of course, it's still useful to be aware of pypyodbc in case pyodbc falls behind again when future versions of Python are released.]
Did you try to download from here? It has an unofficial build for 3.4. I did a quick test myself, looks like it's working fine for me.
I fixed this by installing pyodbc 3.0.10. The latest version of pyodbc didn't work on Windows with Python 3.4
However pyodbc 3.0.10 did work for me
Install command on command prompt : pip install pyodbc 3.0.10
I recently starting playing around with the new features of Python 3.1 and porting one of my 2.6 apps. I was surprised to find that MySQLdb does not yet support any of the 3.x versions of Python. My app uses MySQL extensively, so, as you can imagine, I didn't get too far!
What are my options (if any) for working with MySQL and Python 3.1? I've been out of the Python 3k loop, but cursory search did not yield any evidence of a release date for 3.1 support in MySQLdb or any other alternatives.
mypysql doesn't follow the Python DB API standard, but does support Mysql and Python 3.
You could use pymysql. "The goal of PyMySQL is to be a drop-in replacement for MySQLdb". Check the docs here.
pip install mysqlclient pymysql
Once these libraries are installed, just add the lines in your project wherever MySQLdb is used.
import pymysql
pymysql.install_as_MySQLdb()
I'm using Django and Python 2.6, and I want to grow my application using a MySQL backend. Problem is that there isn't a win32 package for MySQLdb on Python 2.6.
Now I'm no hacker, but I thought I might compile it myself using MSVC++9 Express. But I run into a problem that the compiler quickly can't find config_win.h, which I assume is a header file for MySQL so that the MySQLdb package can know what calls it can make into MySQL.
Am I right? And if so, where do I get the header files for MySQL?
Thanks all! I found that I hadn't installed the developer components in MySQL. Once that was done the problem was solved and I easily compiled the MySQLdb for Python 2.6.
I've made the package available at my site.
I think that the header files are shipped with MySQL, just make sure you check the appropriate options when installing (I think that sources and headers are under "developer components" in the installation dialog).
Have you considered using a pre-built stack with Python, MySQL, Apache, etc.?
For example: http://bitnami.org/stack/djangostack
Also see this post on the mysql-python blog: MySQL-python-1.2.3 beta 2 released - dated March 2009. MySQLdb for Python 2.6 is still a work in progress...