I have a project that contains a lot of library (requirements.txt) and I want to create a dockerfıle when I build this docker file in docker container I need python3.8 and ın python3.8 I need PyQt5 library.
When I create a simple dockerfile just consist of
FROM ubuntu:22.04
COPY . /app
The problem that I facing is when I try:
apt-get install python3-pyqt5
PyQt5 install python3.11 or python 3.10 and install PyQt5 in this directory.
But my project only run in python3.8 what should I do ?
2
Answers
I have uploaded the file Dockerfile like this because I need the architecture of the container arm64
but now I cant install pyqt5 library using
code in the container. Container give's me the error that is
× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [22 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/local/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel whl_basename = backend.build_wheel(metadata_directory, config_settings) File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/sipbuild/api.py", line 46, in build_wheel project = AbstractProject.bootstrap('wheel', File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/sipbuild/abstract_project.py", line 87, in bootstrap project.setup(pyproject, tool, tool_description) File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 586, in setup self.apply_user_defaults(tool) File "/tmp/pip-install-4lcxi4is/pyqt5_d62bb4d4ab2a424eae5f92329bee727e/project.py", line 68, in apply_user_defaults super().apply_user_defaults(tool) File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/pyqtbuild/project.py", line 70, in apply_user_defaults super().apply_user_defaults(tool) File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/sipbuild/project.py", line 237, in apply_user_defaults self.builder.apply_user_defaults(tool) File "/tmp/pip-build-env-mwq0m6h0/overlay/lib/python3.8/site-packages/pyqtbuild/builder.py", line 69, in apply_user_defaults raise PyProjectOptionException('qmake', sipbuild.pyproject.PyProjectOptionException [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
Try this Dockerfile :