Keep in mind that Python versions and libraries dependencies are constantly evolving. Make also sure to use the latest supported versions of both the driver and Python environment when trying this.At the time of writing this article, we’re using the clickhouse-connect driver version
0.5.23 and python 3.11.2 respectively.Steps
- Check the Python version:
- We’ll assemble the project in a folder called
ch-python:
- Create a dependencies file named
requirements.txtwith:
- Create a python source file named
main.py:
- Create the virtual environment:
- Load the virtual environment:
- Launch the code!