{"id":27276,"library":"pydoris","title":"PyDoris","description":"PyDoris is a Python client for Apache Doris, providing a DB-API 2.0 compatible interface to interact with Doris databases. Current version is 1.2.0, supporting Python >=3.7. It connects via MySQL protocol (typically port 9030). The library is maintained by the Apache Doris community.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/apache/doris","tags":["apache-doris","database","mysql-protocol","analytics"],"install":[{"cmd":"pip install pydoris","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import is correct; avoid importing module then accessing attribute.","wrong":"import pydoris\nconnect = pydoris.connect","symbol":"connect","correct":"from pydoris import connect"}],"quickstart":{"code":"import os\nfrom pydoris import connect\n\nhost = os.environ.get('DORIS_HOST', 'localhost')\nport = int(os.environ.get('DORIS_PORT', 9030))\nuser = os.environ.get('DORIS_USER', 'root')\npassword = os.environ.get('DORIS_PASSWORD', '')\ndatabase = os.environ.get('DORIS_DATABASE', 'test')\n\nconn = connect(host=host, port=port, user=user, password=password)\ncursor = conn.cursor()\ncursor.execute(\"SELECT VERSION()\")\nprint(cursor.fetchone())\ncursor.close()\nconn.close()","lang":"python","description":"Connect to Apache Doris, execute a query, and print the version."},"warnings":[{"fix":"Use port 9030 (or your configured query port).","message":"Port should be the MySQL protocol port (default 9030), not the HTTP port (8030). Common mistake caused by misreading Doris documentation.","severity":"gotcha","affected_versions":"all"},{"fix":"Check user host in Doris: `SHOW GRANTS;` and ensure `mysql_native_password` authentication.","message":"PyDoris uses the MySQL protocol; ensure the Doris server has MySQL protocol enabled and the user has proper host permissions.","severity":"gotcha","affected_versions":"all"},{"fix":"Check for updates; consider using official mysql-connector-python if needed.","message":"The `pydoris` package on PyPI is version 1.2.0, which may be outdated compared to latest Doris releases. Many users mistakenly install an old version expecting latest features.","severity":"deprecated","affected_versions":"1.2.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Verify credentials and user host: `CREATE USER 'user'@'%' IDENTIFIED BY 'password';` then GRANT.","cause":"Incorrect username or password, or user not allowed from the connecting host.","error":"pydoris.exceptions.DorisError: (HY000, 'Access denied for user ...')"},{"fix":"Run `pip install pydoris` and ensure you are using the correct Python interpreter.","cause":"Package not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'pydoris'"},{"fix":"Check Doris is running, port is correct (default 9030), and network/firewall rules allow access.","cause":"Doris server not reachable, wrong port, or firewall blocking port 9030.","error":"pydoris.exceptions.DorisError: (2003, \"Can't connect to MySQL server on '...' (timed out)\")"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}