Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InfluxDB Import Error #342

Closed
Marty56 opened this issue Jun 13, 2024 · 3 comments
Closed

InfluxDB Import Error #342

Marty56 opened this issue Jun 13, 2024 · 3 comments
Labels
stale There has not been activity on this issue or PR for quite some time.

Comments

@Marty56
Copy link

Marty56 commented Jun 13, 2024

I am trying to use the influxdb package but the Import does not work.
I am getting the following error

ImportError: cannot import name 'InfluxDBClient' from 'influxdb' (/config/apps/influxdb.py)

My test app is the following


import appdaemon.plugins.hass.hassapi as hass
import datetime
import json
import time
from influxdb import InfluxDBClient


class main(hass.Hass):
    def initialize(self):
        influxdb_server = "localhost"
        json_body = [
            {
                "measurement": "bezug",
                "time": "2009-11-10T23:00:00Z",
                "fields": {
                    "value": 0.64
                }
            }
        ]

        client = InfluxDBClient(influxdb_server, 8086, 'admin', 'admin', 'example')

        client.create_database('example')

        client.write_points(json_body)

        result = client.query('select value from bezug;')

        print("Result: {0}".format(result))

I have installed the "influxdb" package under Configuration and the respective tab "Python Packages" and it seems that it was installed correctly

Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting influxdb
  Downloading influxdb-5.3.2-py2.py3-none-any.whl.metadata (6.9 kB)
Requirement already satisfied: python-dateutil>=2.6.0 in /usr/lib/python3.11/site-packages (from influxdb) (2.8.2)
Requirement already satisfied: pytz in /usr/lib/python3.11/site-packages (from influxdb) (2023.3.post1)
Requirement already satisfied: requests>=2.17.0 in /usr/lib/python3.11/site-packages (from influxdb) (2.28.2)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3.11/site-packages (from influxdb) (1.16.0)
Collecting msgpack (from influxdb)
  Downloading msgpack-1.0.8-cp311-cp311-musllinux_1_1_x86_64.whl.metadata (9.1 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (3.7)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (1.26.18)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3.11/site-packages (from requests>=2.17.0->influxdb) (2024.2.2)
Downloading influxdb-5.3.2-py2.py3-none-any.whl (79 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.4/79.4 kB 1.8 MB/s eta 0:00:00
Downloading msgpack-1.0.8-cp311-cp311-musllinux_1_1_x86_64.whl (409 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 409.1/409.1 kB 6.3 MB/s eta 0:00:00
Installing collected packages: msgpack, influxdb
Successfully installed influxdb-5.3.2 msgpack-1.0.8
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environ
@Marty56
Copy link
Author

Marty56 commented Jun 26, 2024

is this add-on still supported?

@frenck
Copy link
Member

frenck commented Jun 26, 2024

Hi, @Marty56 👋

Yes it is, but your question doesn't seem to be add-on related, but related to the use of ApPDaemon; which might be better asked @ the AppDaemon community.

Just because nobody has given an answer to your question, it doesn't indicate support; it means no one has an answer.

../Frenck

Copy link

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues.
Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Jul 27, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale There has not been activity on this issue or PR for quite some time.
Projects
None yet
Development

No branches or pull requests

2 participants