In this example, we will set up a python environment and run InfluxDB with a python client.
- Install Python.
Assume that you have Python installed. Python 3 is installed by default on modern versions of Ubuntu, type python3 -V to verify. If not, run the following command to install Python 3:
sudo apt-get install python3
- Install InfluxDB-Python.
Install InfluxDB-python by entering the following command:
$ pip install InfluxDB
On Debian/Ubuntu, you can install it with the following command:
sudo apt-get install python-InfluxDB
- Write a Python program.
Type python on the Terminal. It will load the Python shell. Enter the following Python codes line by line. It will print out two records, which are written to ...