Code – die besten Beiträge

Html semibold und bold schauen gleich aus?

Hallo, ich arbeite aktuell an einem NextJS Projekt mit TailwindCSS. Mein Problem ist, dass Font-Weight 600 und 700, 100 bis 500 und 800 und 900 gleich ausschauen. Das ist aber auch bei einem Normalen HTML Dokument so.

Das Problem besteht in allen Browsern.
Danke für die Antwort im Vorraus.

Code zum Nachmachen:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Font Weight Test</title>
    <style>
        body {
            font-family: Arial, sans-serif; /* Using a widely available font */
        }
        .thin {
            font-weight: 100;
        }
        .light {
            font-weight: 300;
        }
        .normal {
            font-weight: 400;
        }
        .medium {
            font-weight: 500;
        }
        .semibold {
            font-weight: 600;
        }
        .bold {
            font-weight: 700;
        }
        .extrabold {
            font-weight: 800;
        }
        .black {
            font-weight: 900;
        }
    </style>
</head>
<body>
    <h1>Font Weight Test</h1>
    <p class="thin">This is thin text (100).</p>
    <p class="light">This is light text (300).</p>
    <p class="normal">This is normal text (400).</p>
    <p class="medium">This is medium text (500).</p>
    <p class="semibold">This is semibold text (600).</p>
    <p class="bold">This is bold text (700).</p>
    <p class="extrabold">This is extrabold text (800).</p>
    <p class="black">This is black text (900).</p>
</body>
</html>   
Bild zum Beitrag
HTML, Webseite, CSS, Mozilla Firefox, Google Chrome, HTML5, Code, Programmiersprache, Webdesign, Webentwicklung, Frontend, Visual Studio Code, Microsoft Edge

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

Meistgelesene Beiträge zum Thema Code