SSL-Paket kann nicht installiert werden. Kann mir jemand das Problem erklären?

Servus alle zusammen.

Ich habe mal wieder eins der unnötigsten Probleme die man so gar nicht gebrauchen kann.
Vorab: Ich verwende PyCharm CommunityEdit2023

Folgende Problematik stellt sich mir:Ich versuche über den PyCharm Interpreter das Paket ssl zu laden und erhalte:

Collecting ssl

 Using cached ssl-1.16.tar.gz (33 kB)

 Using cached ssl-1.15.tar.gz (32 kB)




  ERROR: Command errored out with exit status 1:

   command: 'D:\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_93be5a3dfd464eefb55e12eacc1c7aae\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_93be5a3dfd464eefb55e12eacc1c7aae\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Paddy\AppData\Local\Temp\pip-pip-egg-info-xz6xi0b2'

     cwd: C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_93be5a3dfd464eefb55e12eacc1c7aae\

  Complete output (6 lines):

  Traceback (most recent call last):

   File "<string>", line 1, in <module>

   File "C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_93be5a3dfd464eefb55e12eacc1c7aae\setup.py", line 33

    print 'looking for', f

       ^

  SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?

  ----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/83/21/f469c9923235f8c36d5fd5334ed11e2681abad7e0032c5aba964dcaf9bbb/ssl-1.16.tar.gz#sha256=ac21156fee6aee9eb8d765bbb16f5f49492d81ff4b22f7b8fc001d2251120930 (from https://pypi.org/simple/ssl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

  ERROR: Command errored out with exit status 1:

   command: 'D:\Python\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_0d4afefa00504f218b834c3475a8235c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paddy\\AppData\\Local\\Temp\\pip-install-6xunn48y\\ssl_0d4afefa00504f218b834c3475a8235c\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Paddy\AppData\Local\Temp\pip-pip-egg-info-2f8p2rk1'

     cwd: C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_0d4afefa00504f218b834c3475a8235c\

  Complete output (6 lines):

  Traceback (most recent call last):

   File "<string>", line 1, in <module>

   File "C:\Users\Paddy\AppData\Local\Temp\pip-install-6xunn48y\ssl_0d4afefa00504f218b834c3475a8235c\setup.py", line 74

    print 'looking for', f

       ^

  SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?

  ----------------------------------------

WARNING: Discarding https://files.pythonhosted.org/packages/3a/c2/846a19d1572ec6cb8ac438d58a898de8926d32e13f0355cdf4ab00864b5f/ssl-1.15.tar.gz#sha256=1266302ce62c4b60c7ca0e1d3d104ba11d2749e5881d8ac4f006cf9a0446d589 (from https://pypi.org/simple/ssl/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ERROR: Could not find a version that satisfies the requirement ssl (from versions: 1.15, 1.16)

ERROR: No matching distribution found for ssl

WARNING: You are using pip version 21.1.3; however, version 24.0 is available.

You should consider upgrading via the 'D:\Python\python.exe -m pip install --upgrade pip' command.

Via cmd erhalte ich die gleiche Meldung.
Ich habe alle Python-Versionen schon deinstalliert, System neu gestartet und wieder installiert. Das gleiche habe ich auch mit pip probiert.

Kann mir hier vielleicht jemand weiterhelfen?

Vielen Dank und liebe Grüße im Voraus! :)

cmd, Code, Error, Python, SSL, pip, Python 3, Windows 10, Pycharm
Python Fehlermeldung "KeyError: 'data'"?

Ich möchte gerne einen KI Discord Server machen. Die KI hab ich schon und diese hat auch eine API(?). Ich hab den Bot auch schon auf dem Server und ich kann auch Prompts eingeben. Aber wenn ich Prompt eingebe, kommt bei diesem Code:

import discord
from gradio_client import Client


TOKEN = 'MeinToken'
FOOOCUS_API_URL = 'http://127.0.0.1:7865/'


fooocus_client = Client(FOOOCUS_API_URL)


intents = discord.Intents.default()
client = discord.Client(intents=intents)


@client.event
async def on_ready():
    print(f'{client.user} ist eingeloggt!')


@client.event
async def on_message(message):
    if message.channel.name == 'prompt-kanal' and message.author != client.user:
        result = fooocus_client.predict(message.content, fn_index=2)
        await message.channel.send(file=discord.File(result))


client.run(TOKEN)

Diese Fehlermeldung:

2024-04-16 15:35:07 ERROR discord.client Ignoring exception in on_message
Traceback (most recent call last):
File "C:...\venv\Lib\site-packages\gradio_client\compatibility.py", line 105, in _predict
output = result["data"]
~~~~~~^^^^^^^^
KeyError: 'data'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:...\venv\Lib\site-packages\discord\client.py", line 441, in _run_event
await coro(*args, **kwargs)
File "c:...\bot.py", line 19, in on_message
result = fooocus_client.predict(message.content, fn_index=2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:...\venv\Lib\site-packages\gradio_client\client.py", line 459, in predict
).result()
^^^^^^^^
File "C:...\venv\Lib\site-packages\gradio_client\client.py", line 1374, in result
return super().result(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users..._base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "C:\Users..._base.py", line 401, in __get_result
raise self._exception
File "C:\Users...\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:...\compatibility.py", line 65, in _inner
predictions = _predict(*data)
^^^^^^^^^^^^^^^
File "C:...\compatibility.py", line 119, in _predict
raise KeyError(
KeyError: 'Could not find 'data' key in response. Response received: {'detail': [{'type': 'model_attributes_type', 'loc': ['body'], 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': '{"data": [""], "fn_index": 2, "session_hash": "d7f62bf0-174c-45fe-b3f6-c5e7f00848d3"}', 'url': 'https://errors.pydantic.dev/2.1/v/model_attributes_type'}]}'

Ich checke einfach nicht, woran das liegen könnte...

Linux, Bot, cmd, Code, künstliche Intelligenz, Programmiersprache, Python, Python 3, Pycharm, Discord, Discord Bot, ChatGPT
Wie kann ich die Porcupine Wake-Word detection verwenden?

Hallo,

ich programmiere gerade einen Sprachassistenten und wollte nun die Wake-Word Funktion hinzufügen. Das ist mein Code:

def wait_for_wake_word(recognizer, source):
    keyword_path = r"C:\Users\User\PycharmProjects\voiceAssistant\hey-Luna_de_windows_v3_0_0 (2)\hey-Luna_de_windows_v3_0_0.ppn"
    sensitivity = 0.5
    access_key = "..."

    handle = pvporcupine.create(keywords=[keyword_path], sensitivities=[sensitivity], access_key=access_key)

    if handle is None:
        print("Fehler beim Erstellen des Porcupine-Objekts. Überprüfe den Dateipfad und den Zugriffsschlüssel.")
        return

    audio = pyaudio.PyAudio()

    try:
        print("Warte auf das Wake-Word...")

        stream = audio.open(
            rate=handle.sample_rate,
            channels=1,
            format=pyaudio.paInt16,
            input=True,
            frames_per_buffer=handle.frame_length)

        while True:
            pcm = stream.read(handle.frame_length)
            pcm = pcm[0: handle.frame_length]

            keyword_index = handle.process(pcm)
            if keyword_index >= 0:
                print("Wake-Word 'Luna' erkannt!")
                break
    finally:
        if handle is not None:
            handle.delete()
        if stream is not None:
            stream.close()
        if audio is not None:
            audio.terminate()

Wenn ich es nun aber ausführe, kommt diese Fehlermeldung:

Traceback (most recent call last):

 File "C:\Users\User\PycharmProjects\voiceAssistant\main.py", line 1162, in <module>

  execute()

 File "C:\Users\User\PycharmProjects\voiceAssistant\main.py", line 671, in execute

  wait_for_wake_word(recognizer, source)

 File "C:\Users\User\PycharmProjects\voiceAssistant\main.py", line 121, in wait_for_wake_word

  handle = pvporcupine.create(keywords=[keyword_path], sensitivities=[sensitivity], access_key=access_key)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 File "C:\Users\User\PycharmProjects\voiceAssistant\venv\interpreter\Lib\site-packages\pvporcupine\_factory.py", line 59, in create

  raise ValueError(

ValueError: One or more keywords are not available by default. Available default keywords are:\ngrapefruit, picovoice, terminator, americano, computer, hey siri, bumblebee, hey barista, ok google, alexa, hey google, blueberry, grasshopper, jarvis, porcupine, pico clock

Es liegt aber nicht an einem Rechtschreibfehler im Dateipfad oder im API Key. Woran kann es sonst liegen?

Freundliche Grüsse

cmd, Code, künstliche Intelligenz, Programmiersprache, Python, Python 3, Pycharm

Meistgelesene Beiträge zum Thema Pycharm