influxdb python: 404 page not found

2024/10/6 6:49:02

I am trying to use the influxdb-python lib which I found here. But I cant even get the tutorial programm to work.

When I run the following example code:

$ python>>> from influxdb import InfluxDBClient>>> json_body = [{"measurement": "cpu_load_short","tags": {"host": "server01","region": "us-west"},"time": "2009-11-10T23:00:00Z","fields": {"value": 0.64}}
]>>> client = InfluxDBClient('localhost', 8086, 'root', 'root', 'example')>>> client.create_database('example')

I get this error message with the last line:

>>> client.create_database('example')
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 318, in create_databasestatus_code=201File "/usr/lib/python2.7/dist-packages/influxdb/client.py", line 124, in requestraise InfluxDBClientError(response.content, response.status_code)
influxdb.client.InfluxDBClientError: 404: 404 page not found

My installed version:

pi@raspberrypi:~ $ influx
Visit https://enterprise.influxdata.com to register for updates, InfluxDB server management, and monitoring.
Connected to http://localhost:8086 version 0.9.6.1
InfluxDB shell 0.9.6.1

It would be really nice if somebody can point me to my probleme here.

UPDATE

Maybe this is helpful. I am on a Raspberry Pi 3 with Jessie and installed influxdb with this tuturial link

UPDATE 2

if I run curl http://localhost:8086 I also get 404 page not found. On the Port 8083 i get a response.

Answer

I couldn't post a comment since I don't have the reputation.

I found the same issue with a raspberry PI and v0.12.2. If you go to https://docs.influxdata.com/influxdb/v0.12/guides/writing_data/ there is this command

curl -G http://localhost:8086/query --data-urlencode "q=CREATE DATABASE mydb"

It worked for me.

UPDATE 1

I don't think you've installed the Python InfluxDB driver correctly. Follow the steps on the InfluxDB-Python page. Specifically be sure to run the following commands as sudo.

pip install influxdb

pip install --upgrade influxdb

https://en.xdnf.cn/q/70396.html

Related Q&A

Django Table already exist

Here is my Django Migration file. When I run python manage.py makemigrations/migrate I get this error.Error:-django.db.utils.OperationalError: (1050, "Table tickets_duration already exists")I…

Python round() too slow, faster way to reduce precision?

I am doing the following:TOLERANCE = 13 some_float = ... round(some_float, TOLERANCE)This is run many times, so performance is important. I have to round some_float due to floating point representation…

Reading .doc file in Python using antiword in Windows (also .docx)

I tried reading a .doc file like - with open(file.doc, errors=ignore) as f:text = f.read()It did read that file but with huge junk, I cant remove that junk as I dont know from where it starts and where…

Error installing package with pip

Im trying to install a charting tool (matplotlib-v1.4.2) for python 3.4 in Windows 7, so far all my trails doesnt seem to do the job.Attempts:Ive downloaded pip from GitHub python -m pip install matplo…

Assign new values to certain tensor elements in Keras

I need to change the value of some elements of a tensor. I know what elements -- they are in a boolean tensor already.I dont see how to do this in keras code. But if I were using TensorFlow code I woul…

Making grid triangular mesh quickly with Numpy

Consider a regular matrix that represents nodes numbered as shown in the figure:I want to make a list with all the triangles represented in the figure. Which would result in the following 2 dimensional…

df [X].unique() and TypeError: unhashable type: numpy.ndarray

all,I have a column in a dataframe that looks like this:allHoldingsFund[BrokerMixed] Out[419]: 78 ML 81 CITI 92 ML 173 CITI 235 ML 262 ML 264 ML 25617 …

Python pandas idxmax for multiple indexes in a dataframe

I have a series that looks like this:delivery 2007-04-26 706 23 2007-04-27 705 10706 1089708 83710 13712 51802 4806 181…

No of Pairs of consecutive prime numbers having difference of 6 like (23,29) from 1 to 2 billion

How to find number of pairs of consecutive prime numbers having difference of 6 like (23,29) from 1 to 2 billion (using any programming language and without using any external libraries) with consideri…

Building a docker image for a flask app fails in pip

from alpine:latest RUN apk add --no-cache python3-dev \&& pip3 install --upgrade pipWORKDIR /backend COPY . /backendRUN pip --no-cache-dir install -r requirements.txt EXPOSE 5000 ENTRYPOINT [py…