Die Suche ergab 34 Treffer

von sophe_9
Mittwoch 6. März 2024, 08:36
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

Vielen Dank.

das war die Lösung!

Jetzt habe ich es verstanden, eine base64 Enkodierung ist nicht mehr nötig.

:lol: :lol: :lol:
von sophe_9
Dienstag 5. März 2024, 17:41
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

img = mpimg.imread('Scan.png') db.put_attachment(doc, img, "scan.png" , content_type="image/png") Dann erhalte ich folgenden Fehler: File ~\AppData\Local\Programs\Python\Python312\Lib\json\encoder.py:180 in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeEr...
von sophe_9
Dienstag 5. März 2024, 17:20
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

Beim Öffnen des Attachments in der CouchDB erhalte ich folgende Fehlermeldung: " Die Grafik kann nicht angezeigt werden, weil sie Fehler enthält". Laut Beschreibung von dem Paket "couch-python", sollte es mit "put_attachment(doc, content, filename=None, content_type=None)&qu...
von sophe_9
Dienstag 5. März 2024, 16:56
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

Auch damit habe ich keinen Erfolg.

Code: Alles auswählen

db.put_attachment(doc, img, "scan_plot.png", content_type="image/png;base64")
von sophe_9
Dienstag 5. März 2024, 16:48
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

So ganz habe ich es noch nicht verstanden. content ist der Inhalt, den ich anhängen möchte. In meinem Fall "img". Es funktioniert leider noch nicht. with open("Scan.png", "rb") as img_file: img = base64.b64encode(img_file.read()) img = img.decode('utf-8') db.put_attachm...
von sophe_9
Dienstag 5. März 2024, 15:58
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Re: Couchdb python - Upload Attachment mit put_attachment

Danke für die Antwort, ich habe bei den Beschreibungen " put_attachment(doc, content, filename=None, content_type=None)" gefunden, mit einer Textdatei hat es wunderbar funktioniert. Nur pdfs oder images sind ein Problem. Wahrscheinlich ist mein Ansatz falsch, wahrscheinlich muss ich den Pl...
von sophe_9
Dienstag 5. März 2024, 14:03
Forum: Datenbankprogrammierung mit Python
Thema: Couchdb python - Upload Attachment mit put_attachment
Antworten: 13
Zugriffe: 663

Couchdb python - Upload Attachment mit put_attachment

Hallo, ich versuche an ein bereits existierendes Document ein Bild bzw. Plot als png anzuhängen. Es wird auch angehängt, aber es erscheint folgender Fehler: " Die Grafik kann nicht angezeigt werden, weil sie Fehler enthält". Ich vermute die Codierung ist fehlerhaft, da auch die Länge in de...
von sophe_9
Donnerstag 21. September 2023, 14:06
Forum: Allgemeine Fragen
Thema: elab / elabapi-python
Antworten: 8
Zugriffe: 707

Re: elab / elabapi-python

#!/usr/bin/env python import time import elabapi_python from elabapi_python.rest import ApiException # necessary imports for this example import csv import json # replace with your api key API_HOST_URL = 'https://elabftw.ptb.de/api/v2' # replace with your api key API_KEY = 'a2c...meinkey.....4ed30c...
von sophe_9
Donnerstag 21. September 2023, 08:26
Forum: Allgemeine Fragen
Thema: elab / elabapi-python
Antworten: 8
Zugriffe: 707

Re: elab / elabapi-python

Ihr wisst also selber nicht, wo mein Fehler liegt.

So wie es in dem Link beschrieben ist, funktioniert es nicht. Habe mich vorher natürlich damit beschäftigt.

Habt ihr mit dem Laborbuch denn schon mal gearbeitet?
von sophe_9
Mittwoch 20. September 2023, 17:19
Forum: Allgemeine Fragen
Thema: elab / elabapi-python
Antworten: 8
Zugriffe: 707

Re: elab / elabapi-python

Es ist nicht der richtige API-KEY. Leider hilft mir der Link https://doc.elabftw.net/api/v2/#/Tags/post-tag nicht weiter, dort wird eine json struktur beschrieben. Hier gibt es es ganz gute Beispiele https://doc.elabftw.net/api/elabapi-html/#api-Tags-postTag. Daran habe ich mich bis jetzt orientiert...
von sophe_9
Mittwoch 20. September 2023, 15:49
Forum: Allgemeine Fragen
Thema: elab / elabapi-python
Antworten: 8
Zugriffe: 707

elab / elabapi-python

Hallo zusammen, ich habe ein Problem mit dem Laborbuch elabftw: Ich kann den Titel, Kommentare und den Body ändern, aber keine Tags wählen oder neu erzeugen. Hier ändern ich den Titel und es funktioniert: import elabapi_python from elabapi_python.rest import ApiException ######################### # ...
von sophe_9
Montag 18. September 2023, 12:56
Forum: Allgemeine Fragen
Thema: Jupyter Arbeitsverzeichnis ändern
Antworten: 1
Zugriffe: 361

Jupyter Arbeitsverzeichnis ändern

Hallo zusammen, ich verwende Jupyter und möchte das Arbeitsverzeichnis ändern. Nachdem ich in "jupyter_notebook_config.py" den Pfad in c.NotebookApp.notebook_dir = 'C:/Users/becker07/notebook' geändert habe, erhalte ich folgende Fehlermeldung: c.NotebookApp.notebook_dir = 'C:/Users/becker0...
von sophe_9
Freitag 17. Dezember 2021, 09:56
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

Vielen Dank,

konnte das Problem lösen.
von sophe_9
Donnerstag 16. Dezember 2021, 15:31
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

An diese Stelle? compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED if not dry_run: z = zipfile.ZipFile(zip_filename, mode, compression=compression) print(path) for dirname, dirs, files in sorted_walk(base_dir): visit(z, dirname, files) z.close() else: for dirname, dirs, files in...
von sophe_9
Donnerstag 16. Dezember 2021, 15:16
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

Diese Meldung erhalte ich: C:\Users\becker07\Documents\pycouchdb-1.14.1.tar\pycouchdb-1.14.1>python setup.py install running install running bdist_egg running egg_info writing pycouchdb.egg-info\PKG-INFO writing dependency_links to pycouchdb.egg-info\dependency_links.txt writing requirements to pyco...
von sophe_9
Donnerstag 16. Dezember 2021, 15:04
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

Wie kann ich print-statesments einfügen?
von sophe_9
Donnerstag 16. Dezember 2021, 14:41
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

Richtig, ich habe keinen Zugang zum Netz (Proxy), daher erst der Download und dann die Installation. Das ist der ganze Fehler: File "C:\Users\becker07\AppData\Local\Programs\Python\Python39\lib\zipfile.py", line 361, in __init__ raise ValueError('ZIP does not support timestamps before 1980...
von sophe_9
Donnerstag 16. Dezember 2021, 14:30
Forum: Installation/Konfigurieren
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 2
Zugriffe: 1190

Re: ValueError: ZIP does not support timestamps before 1980

Hatte die Frage außversehen bei den allgemeinen Fragen gestellt
von sophe_9
Donnerstag 16. Dezember 2021, 14:23
Forum: Allgemeine Fragen
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 16
Zugriffe: 862

Re: ValueError: ZIP does not support timestamps before 1980

Die Frage verstehe ich nicht! Auf die aktuelle Zeit....
von sophe_9
Donnerstag 16. Dezember 2021, 14:20
Forum: Installation/Konfigurieren
Thema: ValueError: ZIP does not support timestamps before 1980
Antworten: 2
Zugriffe: 1190

ValueError: ZIP does not support timestamps before 1980

Hallo,

ich habe folgendes Problem. Ich habe ganz klassisch mit

python setup.py install

versucht ein Paket zu installieren. Es gab diese Fehlermeldung

ValueError: ZIP does not support timestamps before 1980

Ich arbeite mit Windows 10, Python 3.9.5 und pip 21.1.1