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