Мой Dockerfile устанавливает bcrypt, как показано ниже:
Код: Выделить всё
FROM python:3.13-slim
WORKDIR /app
COPY service.py .
COPY f3login.py .
COPY dbaccess.py .
COPY requirements.txt .
RUN mkdir ./assets
RUN apt update
RUN apt install -y curl gcc g++
RUN curl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
RUN echo "1f584ffd368d18c64b8820bf6cd9b1114dda11a0ecf9524be3c967a3a5be941b mariadb_es_repo_setup" | sha256sum -c -
RUN chmod +x mariadb_es_repo_setup
RUN ./mariadb_es_repo_setup --mariadb-server-version="mariadb-10.6"
RUN apt install -y libmariadb3 libmariadb-dev
RUN pip3 install --no-cache-dir --upgrade pip
RUN pip3 install --no-cache-dir "bcrypt>=4.3.0"
RUN pip3 install mariadb
RUN pip3 install openai
RUN pip3 install langchain
RUN pip3 install langchain_openai
RUN pip3 install -U extra-streamlit-components
RUN pip3 install streamlit
RUN pip3 install streamlit-browser-engine
RUN pip3 install pymal
CMD ["python3","-m","streamlit","run","f3aichatter.py"]
приложению. Тогда я получаю следующее:
Код: Выделить всё
service | 2025-11-26 04:42:25.690 Uncaught app execution
service | Traceback (most recent call last):
service | File "/usr/local/lib/python3.13/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 129, in exec_func_with_error_handling
service | result = func()
service | File "/usr/local/lib/python3.13/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 669, in code_to_exec
service | exec(code, module.__dict__) # noqa: S102
service | ~~~~^^^^^^^^^^^^^^^^^^^^^^^
service | File "/app/f3aichatter.py", line 3, in
service | from f3login import F3Login
service | File "/app/f3login.py", line 5, in
service | import bcrypt
service | ModuleNotFoundError: No module named 'bcrypt'
все остальные библиотеки (f3login.py загружает bcrypt последним). Приложение должно загрузить bcrypt, но это не так.
К вашему сведению: ниже приведен журнал установки bcrypt:
Код: Выделить всё
#20 [16/24] RUN pip3 install --no-cache-dir bcrypt
#20 2.138 Collecting bcrypt
#20 2.230 Downloading bcrypt-5.0.0-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (10 kB)
#20 2.255 Downloading bcrypt-5.0.0-cp39-abi3-manylinux_2_34_x86_64.whl (278 kB)
#20 2.332 Installing collected packages: bcrypt
#20 2.538 Successfully installed bcrypt-5.0.0
#20 2.539 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
#20 DONE 4.1s
Подробнее здесь: https://stackoverflow.com/questions/798 ... founderror
Мобильная версия