Python – die besten Beiträge

Probleme mit Linux Server und dpkg?

Ich versuche grade auf meinem 1blu Linux Server einen Modded Minecraft Server zu installieren. Ich folge einer Youtube Anleitung und direkt zu Beginn soll ich "sudo apt install default-jdk" eingeben. Dies tue ich und bekomme diese Antwort:

"Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
default-jdk is already the newest version (2:1.21-75+exp1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
8 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] yy
Setting up tzdata (2025b-0ubuntu0.24.04.1) ...
dpkg: error processing package tzdata (--configure):
 installed tzdata package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of libpython3.12-stdlib:amd64:
 libpython3.12-stdlib:amd64 depends on tzdata; however:
 Package tzdata is not configured yet.
dpkg: error processing package libpython3.12-stdlib:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3.12t64-dbg:amd64:
 libpython3.12t64-dbg:amd64 depends on libpython3.12-stdlib (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12-stdlib:amd64 is not configured yet.
dpkg: error processing package libpython3.12t64-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.12:
 python3.12 depends on libpython3.12-stdlib (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12-stdlib:amd64 is not configured yet.
 python3.12 depends on tzdata; however:
 Package tzdata is not configured yet.
dpkg: error processing package python3.12 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3.12-dev:amd64:
 libpython3.12-dev:amd64 depends on libpython3.12-stdlib (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12-stdlib:amd64 is not configured yet.
dpkg: error processing package libpython3.12-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpython3.12t64:amd64:
 libpython3.12t64:amd64 depends on libpython3.12-stdlib (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12-stdlib:amd64 is not configured yet.
dpkg: error processing package libpython3.12t64:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.12-dev:
 python3.12-dev depends on python3.12 (= 3.12.3-1ubuntu0.7); however:
 Package python3.12 is not configured yet.
 python3.12-dev depends on libpython3.12-dev (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12-dev:amd64 is not configured yet.
 python3.12-dev depends on libpython3.12t64 (= 3.12.3-1ubuntu0.7); however:
 Package libpython3.12t64:amd64 is not configured yet.
dpkg: error processing package python3.12-dev (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of vim:
 vim depends on libpython3.12t64 (>= 3.12.1); however:
 Package libpython3.12t64:amd64 is not configured yet.
dpkg: error processing package vim (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 tzdata
 libpython3.12-stdlib:amd64
 libpython3.12t64-dbg:amd64
 python3.12
 libpython3.12-dev:amd64
 libpython3.12t64:amd64
 python3.12-dev
 vim
E: Sub-process /usr/bin/dpkg returned an error code (1)

Das ganze habe ich Gegoogelt und nichts hat bisher funktioniert. Ich wäre dankbar wenn jemand der sich damit auskennt mir weiterhelfen kann, da ich selber absolut kein profi bin. Mir würde auch eine genauere Erläuterung des Problems helfen.

Danke im Vorraus!

Linux, Minecraft Mods, Minecraft Server, Python, ssh, Python 3

Warum synchronisiert Discord die Befehle meines Bots nicht?

Hallow!

Ich bin gerade dabei einen Discord Geburtstagsbot zu schreiben.

Der Code funktioniert super, jedoch habe ich seit gestern (06.07) das Problem, dass meine Befehle, die ich hinzufüge oder aktualisiere, nicht in Discord geändert werden.

Ich habe zuerst versucht, direkt am Start eine Sync zu starten:

await bot.tree.sync() 
print("Slash Commands synchronisiert.") 

Als ich dann aber gelesen habe, dass es dabei ein Limit gäbe, habe ich die Autosync rausgenommen und einen eigenen Befehl erstellt (Was ziemlich blöd war von mir, was bringt der mir, wenn ich den Bot ja nicht syncen kann?)

@bot.event async def on_ready(): logging.info(f'{bot.user} hat sich erfolgreich angemeldet und ist bereit!') 
print("-" * 30) 
print("Versuche Slash Commands zu synchronisieren...")
 try: synced = await bot.tree.sync() 
# Versucht globale Synchronisierung 
logging.info(f"Erfolgreich {len(synced)} Slash Commands synchronisiert.") 
 for command in synced: 
  print(f"Synchronisierter Befehl: /{command.name}") print("-" *30) except Exception as e: logging.error(f"Fehler bei der Synchronisierung der Slash Commands: {e}", exc_info=True) print("-" * 30)

(Gutefrage hat den Code in ein komisches Format gebracht und bin zu faul, den wieder richtig zu ordnen lol)

Da das Sync Limit angeblich nur pro Tag gilt, sollte es heute eigentlich wieder gehen, tut es aber nicht.

Ich habe auch schon einen neuen Bot mit einer neuen Application erstellt, in der Hoffnung, dass der Sync dann wieder funktioniert, aber selbst nach einer Stunde wurde kein Befehl für den neuen Bot hinzugefügt. Die Bots selber sind aber online und in der Konsole wird bestätigt, dass der Bot erfolgreich angemeldet wurde.

Ich hab keinen Plan, wie ich den Sync wieder zum Laufen bekomme. Kann mir jemand helfen? Dankeee!

LG, Chris!

App, Bot, Command, Programmiersprache, Python, Synchronisierung, Discord, Discord Bot, discord.py

Meistgelesene Beiträge zum Thema Python