Python Bukkit Plugin Fehler?

Hallo,

Ich wollte mich mal damit Beschäftigen, wie man für Minecraft Plugins in Python programmiert. Dafür habe ich mir einen Bukkit-Server eingerichtet und das Plugin PPLoader installiert, damit ich selber Plugins in Python entwickeln kann.

Ich habe mir dann ein passendes Verzeichnis erstellt und mir die beiden notwendigen Dateien erstellt.

plugin.py:

class HelloPlugin(PythonPlugin):
    def onEnable(self):
        self.getLogger().info("Hello world!")

plugin.yml:

name: Hello Plugin
mani: HelloPlugin
version: 1.0

Aber leider wenn ich meinen Server starte bekomme ich folgenden Fehler:

[16:41:54] [Server thread/INFO]: [PPLoader] Loading PPLoader v1.2.0
[16:41:54] [Server thread/INFO]: [PPLoader] Loading Plugin Hello.py.dir
[16:41:54] [Server thread/WARN]: org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.InvalidDescriptionException: main is not defined
[16:41:54] [Server thread/WARN]:    at org.cyberlis.pyloader.PythonPluginLoader.loadPlugin(PythonPluginLoader.java:160)
[16:41:54] [Server thread/WARN]:    at org.cyberlis.pyloader.PythonPluginLoader.loadPlugin(PythonPluginLoader.java:119)
[16:41:54] [Server thread/WARN]:    at org.cyberlis.pyloader.PythonPluginLoader.loadPlugin(PythonPluginLoader.java:93)
[16:41:54] [Server thread/WARN]:    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:393)
[16:41:54] [Server thread/WARN]:    at org.cyberlis.pyloader.PythonLoader.onLoad(PythonLoader.java:85)
[16:41:54] [Server thread/WARN]:    at org.bukkit.craftbukkit.v1_20_R3.CraftServer.loadPlugins(CraftServer.java:433)
[16:41:54] [Server thread/WARN]:    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:213)
[16:41:54] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:979)
[16:41:54] [Server thread/WARN]:    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:296)
[16:41:54] [Server thread/WARN]:    at java.base/java.lang.Thread.run(Thread.java:1583)
[16:41:54] [Server thread/WARN]: Caused by: org.bukkit.plugin.InvalidDescriptionException: main is not defined
[16:41:54] [Server thread/WARN]:    at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:1037)
[16:41:54] [Server thread/WARN]:    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:264)
[16:41:54] [Server thread/WARN]:    at org.cyberlis.pyloader.PythonPluginLoader.loadPlugin(PythonPluginLoader.java:152)
[16:41:54] [Server thread/WARN]:    ... 9 more
[16:41:54] [Server thread/WARN]: Caused by: java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "java.util.Map.get(Object)" is null
[16:41:54] [Server thread/WARN]:    at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:1032)
[16:41:54] [Server thread/WARN]:    ... 11 more

Viele Grüße und danke für eine Antwort

TheCPP

Minecraft, Minecraft Server, Plug-in, Python, Bukkit, Bukkit-Plugin
Python Fehler bei Multiprocessing?

Hallo,

Momentan schreibe ich eine kleine Anwendung die Text sprechen soll. Mein Code:

Voice.py

from loguru import logger
import pyttsx3
import multiprocessing


class Voice():


    def __init__(self):
        import YAML
        self.process = None
        logger.debug("[CONFIG] Reading Config Data")
        self.voiceId = YAML.config['assistant']['Voice']['VoiceID']
        logger.debug("[Start] Voice initialistion")
        self.engine = pyttsx3.init()
        self.engine.setProperty('voice', self.voiceId)
        logger.debug("[Finish] Voice initialistion")


    def __speak__(self, text):
        self.engine.say(text)
        self.engine.runAndWait()
    
    def say(self, text):
        if self.process:
            self.stop()
        logger.debug("[START] Say process")
        p = multiprocessing.Process(target=self.__speak__, args=(text, ))
        p.start()
        self.process = p


    def stop(self):
        if self.process:
            self.process.terminate()
            logger.info("[STOPP] Say process")

Main.py

from loguru import logger
import Voice
logger.info("[START] ...")
self.Voice = Voice.Voice()
logger.info("...")
self.Voice.say("Initalisierung abgeschloßen")

Bei der Ausführung wird mir aber folgender Fehler ausgegeben:

Traceback (most recent call last):
  File "C:\Users\toni-\Desktop\VoiceAssistant\main.py", line 15, in <module>
    Assistant = VoiceAssistant()
                ^^^^^^^^^^^^^^^^
  File "C:\Users\toni-\Desktop\VoiceAssistant\main.py", line 9, in __init__
    self.Voice.say("Initalisierung abgeschloßen")
  File "C:\Users\toni-\Desktop\VoiceAssistant\Voice.py", line 26, in say
    p.start()
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 121, in start
    self._popen = self._Popen(self)
                  ^^^^^^^^^^^^^^^^^
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\context.py", line 336, in _Popen
    return Popen(process_obj)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\popen_spawn_win32.py", line 94, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'module' object
PS C:\Users\toni-\Desktop\VoiceAssistant> Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\toni-\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\spawn.py", line 106, in spawn_main
    source_process = _winapi.OpenProcess(
                     ^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 87] Falscher Parameter
Programmiersprache, Python, Python 3
Ubuntu croos-compiler installieren?

Wie kann man unter Ubuntu passende Croos-Compiler installieren. Ich habe schon das Tutorial auf folgender Seite ausprobiert bei mir kommt dann aber eine Fehler-Meldung:

TheCPP@TheCPP:~/OS/HelloOs$ sudo apt-get install foo build-essential bison flex libgmp3-dev libmpc-dev libmpfr-dev textinfo libcloog-isl-dev libisl-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libcloog-isl-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source


E: Unable to locate package foo
E: Unable to locate package textinfo
E: Package 'libcloog-isl-dev' has no installation candidate

Ich habe folgende Zwei Befehle auch schon ausprobiert es hat aber auch nicht funktioniert:

TheCPP@TheCPP:~/OS/HelloOs$ sudo apt update
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
Fetched 99.8 kB in 1s (75.1 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
TheCPP@TheCPP:~/OS/HelloOs$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Danke für eine Antwort

TheCPP

Linux, Ubuntu, Debian