{"id":24377,"library":"pypyodbc","title":"pypyodbc","description":"A pure Python ctypes-based ODBC module supporting multiple databases (SQL Server, Oracle, MySQL, PostgreSQL, SQLite, etc.). Current version 1.3.6 (2022-08-29). Release cadence is sporadic; last release fixed metadata issues from 1.3.5.","status":"active","version":"1.3.6","language":"python","source_language":"en","source_url":"https://github.com/pypyodbc/pypyodbc","tags":["odbc","database","pure-python","windows","linux","macos"],"install":[{"cmd":"pip install pypyodbc","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"No common mistake; just import the module.","wrong":"","symbol":"pypyodbc","correct":"import pypyodbc"},{"note":"Direct import from pypyodbc works.","wrong":"","symbol":"DatabaseError","correct":"from pypyodbc import DatabaseError"}],"quickstart":{"code":"import pypyodbc\n\n# Replace with your actual DSN or connection string\nconnection = pypyodbc.connect('DSN=my_dsn;UID=user;PWD=password')\ncursor = connection.cursor()\ncursor.execute(\"SELECT 'Hello, World!' AS greeting\")\nfor row in cursor.fetchall():\n    print(row['greeting'])\ncursor.close()\nconnection.close()","lang":"python","description":"Simple connection and query using a DSN."},"warnings":[{"fix":"Always call pypyodbc.connect() not pyodbc.connect().","message":"pypyodbc does not use pyodbc's function names like 'connect' directly on module level; you must use pypyodbc.connect().","severity":"gotcha","affected_versions":"all"},{"fix":"Use proper ODBC connection strings; see documentation.","message":"Connection strings must be formatted for ODBC, not for native database drivers. For example, SQL Server requires 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=...'.","severity":"gotcha","affected_versions":"all"},{"fix":"Install unixODBC and driver (e.g., freetds, msodbcsql17).","message":"On macOS/Linux, you need to install unixODBC and appropriate ODBC drivers. pypyodbc itself is pure Python but ODBC driver layer is not.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'-08':24 '-29':25 '1.3.5':36 '1.3.6':22 '2022':23 'base':7 'cadenc':27 'ctype':6 'ctypes-bas':5 'current':20 'databas':12,38 'etc':19 'fix':32 'issu':34 'last':30 'linux':43 'maco':44 'metadata':33 'modul':9 'multipl':11 'mysql':16 'odbc':8,37 'oracl':15 'postgresql':17 'pure':3,40 'pure-python':39 'pypyodbc':1 'python':4,41 'releas':26,31 'server':14 'sporad':29 'sql':13 'sqlite':18 'support':10 'version':21 'window':42","created_at":"2026-05-01T08:12:45.883855+00:00","updated_at":"2026-05-01T08:12:45.883855+00:00","problems":[{"fix":"Install ODBC driver (e.g., msodbcsql17) and configure DSN or use full connection string.","cause":"ODBC driver not installed or DSN not configured.","error":"Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified')"},{"fix":"Check connection string format: 'DRIVER={...};SERVER=...;DATABASE=...;UID=...;PWD=...'.","cause":"Connection string syntax error, often missing semicolon or incorrect attribute.","error":"pypyodbc.DatabaseError: ('HY024', '[HY024] [Microsoft][ODBC Driver 17 for SQL Server]Invalid connection string attribute (0) (SQLDriverConnect)')"},{"fix":"Run 'pip install pypyodbc'.","cause":"pypyodbc not installed.","error":"ModuleNotFoundError: No module named 'pypyodbc'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.3.6","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/pypyodbc/pypyodbc","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pypyodbc/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}