Ich denke, ich habe verschiedene Lösungen ausprobiert, ich habe viele Stunden damit verbracht, bevor ich diesen Beitrag gesendet habe, aber ich kann MySlef immer noch nicht bewältigen. Ich leite Docker -Container mit Rag Chatbot aus. Sie werden auch feststellen, dass ich den App -Ordner nicht von meinem Localhost in ein Bild kopiere, da ich Volumes an die Anwendung, DB und Dokumente montiere. Könntest du mir helfen, das Problem zu lösen? Hier ist die Dockerfile: < /p>
# Use a lightweight Python base image with necessary dependencies
FROM python:3.10-slim
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app
# Install necessary system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libgl1-mesa-glx \
libglib2.0-0 \
libpoppler-cpp-dev \
tesseract-ocr \
portaudio19-dev \
git \
ffmpeg \
mpg321 \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /app
# Copy the requirements.txt into the container
COPY requirements.txt /app/
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose API port (FastAPI will run on port 8000)
EXPOSE 8000
# Copy the application files into the container
#COPY . /app
# Start the bash shell and keep the container running
CMD ["bash", "-c", "while true; do sleep 1000; done"]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 68, in serve
config.load()
File "/usr/local/lib/python3.10/site-packages/uvicorn/config.py", line 473, in load
self.loaded_app = import_from_string(self.app)
File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 24, in import_from_string
raise exc from None
File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 992, in _find_and_load_unlocked
File "", line 241, in _call_with_frames_removed
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/app/app/__init__.py", line 4, in
from app.main import app
File "/app/app/main.py", line 4, in
from app.routes.voice_mode import router as voice_router
File "/app/app/routes/voice_mode.py", line 3, in
from .sst import speech_to_text
ModuleNotFoundError: No module named 'app.routes.sst'
Die Datei der /app/app/routes/voice_mode.py ist diese:
Ich denke, ich habe verschiedene Lösungen ausprobiert, ich habe viele Stunden damit verbracht, bevor ich diesen Beitrag gesendet habe, aber ich kann MySlef immer noch nicht bewältigen. Ich leite Docker -Container mit Rag Chatbot aus. Sie werden auch feststellen, dass ich den App -Ordner nicht von meinem Localhost in ein Bild kopiere, da ich Volumes an die Anwendung, DB und Dokumente montiere. Könntest du mir helfen, das Problem zu lösen? Hier ist die Dockerfile: < /p> [code]# Use a lightweight Python base image with necessary dependencies FROM python:3.10-slim
# Set environment variables ENV DEBIAN_FRONTEND=noninteractive \ PYTHONUNBUFFERED=1 \ PYTHONPATH=/app
16 directories, 40 files < /code> Ich führe meine Anwendung im Container mit diesem Befehl aus: < /p> uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 [/code] [b] Und ich erhalte [/b] [code]Traceback (most recent call last): File "/usr/local/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 68, in serve config.load() File "/usr/local/lib/python3.10/site-packages/uvicorn/config.py", line 473, in load self.loaded_app = import_from_string(self.app) File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 24, in import_from_string raise exc from None File "/usr/local/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string module = importlib.import_module(module_str) File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 992, in _find_and_load_unlocked File "", line 241, in _call_with_frames_removed File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/app/app/__init__.py", line 4, in from app.main import app File "/app/app/main.py", line 4, in from app.routes.voice_mode import router as voice_router File "/app/app/routes/voice_mode.py", line 3, in from .sst import speech_to_text ModuleNotFoundError: No module named 'app.routes.sst' [/code] Die Datei der /app/app/routes/voice_mode.py ist diese: [code]from fastapi import APIRouter #from app.sst import speech_to_text - FAILS #from ..sst import speech_to_text - FAILS from .sst import speech_to_text from .tts import text_to_speech import openai [/code] (ruhen Sie nicht relevant, es fällt in Zeile 4) aus .Sst [url=viewtopic.php?t=8986]importieren[/url] rede_to_text
Ich verwende Pre-Commit. In einem der Hooks verwende ich ein Python-Skript, das die Yaml-Bibliothek importiert.
Wenn ich jedoch versuche, etwas zu committen, erhalte ich bei diesem Hook die folgende...
Ich erhalte eine Fehlermeldung bei Importanfragen
Ich habe versucht, es zu deinstallieren und neu zu installieren, habe aber alles auf der ersten Seite von Google gesehen und hoffe auf weitere Hilfe...
Ich baue eine DAG, die Pandas verwendet, aber sie spiegelt sich nicht im Airflow wider. WebUi zeigt an, dass Pandas nicht gefunden wurde. Ich habe es auf meinem lokalen Rechner installiert und wsl...
Ich versuche, die Gmail-API in Python zum Senden von E-Mails zu verwenden, komme aber trotz der Verwendung von „pip install --upgrade google-api-python-client“ oder „pip install google“ nicht über...