Home > Blockchain >  How to dockerize a python app built with conda
How to dockerize a python app built with conda

Time:07-06

I'm trying to Dockerize a python app built using conda. I'm new to Docker. I prepared a Dockerfile, but I'm having problemes when I'm trying to build the project, exactly at step "RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt". The error is: "No matching distribution found for Name_Of_Module". I think the problem is with requirements.txt file

Dockerfile:

FROM python:3.8-alpine

WORKDIR /app

COPY ./requirements.txt /app/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt

COPY . /app

CMD ["uvicorn", "app_server:app", "--host", "0.0.0.0", "--port", "80"]

requirements.txt:

alabaster==0.7.12
anyio==3.6.1
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.2
asgiref==3.5.2
astroid==2.6.6
asttokens==2.0.5
atomicwrites==1.4.0
attrs==21.4.0
autopep8==1.6.0
babel==2.9.1
backcall==0.2.0
bcrypt==3.2.0
beautifulsoup4==4.11.1
binaryornot==0.4.4
black==19.10b0
blas==1.0
bleach==4.1.0
bottleneck==1.3.4
brotlipy==0.7.0003
ca-certificates==2022.6.15
cairo==1.16.0
cairocffi==1.3.0
cairosvg==2.5.2
certifi==2022.6.15
cffi==1.15.0
chardet==4.0.0003
charset-normalizer==2.0.4
click==8.0.4
cloudpickle==2.0.0
colorama==0.4.4
cookiecutter==1.7.3
cryptography==37.0.1
cssselect2==0.2.1
debugpy==1.5.1
decorator==5.1.1
defusedxml==0.7.1
diff-match-patch
docutils==0.17.1
entrypoints==0.4
executing==0.8.3
fastapi==0.78.0
flake8==3.9.2
freetype==2.10.4
fribidi==1.0.10
gdk-pixbuf==2.42.6
gettext==0.19.8.1
glib==2.68.4
glib-tools==2.68.4
h11==0.13.0
html5lib==1.1
icu==58.2
idna==3.3
imagesize==1.3.0
importlib-metadata==4.11.3
importlib_metadata==4.11.3
importlib_resources==5.2.0
inflection==0.5.1
intel-openmp==2021.4.0
intervaltree==3.1.0
ipykernel==6.9.1
ipython==8.3.0
ipython_genutils==0.2.0
isort==5.9.3
jedi==0.18.1
jinja2==3.0.3
jinja2-time==0.2.0
jpeg==9e
jsonschema==4.4.0
jupyter_client==6.1.12
jupyter_core==4.10.0
jupyterlab_pygments==0.1.2
kaleido-core==0.2.1
keyring==23.4.0
lazy-object-proxy==1.6.0
lcms2==2.12
libffi==3.4.2
libglib==2.68.4
libiconv==1.16
libpng==1.6.37
libpq==12.9
libspatialindex==1.9.3
libtiff==4.2.0
lz4-c==1.9.3
markupsafe==2.1.1
mathjax==2.7.7
matplotlib-inline==0.1.2
mccabe==0.6.1
mistune==0.8.4
mkl==2021.4.0
mkl-service==2.4.0
mkl_fft==1.3.1
mkl_random==1.2.2
mypy_extensions==0.4.3
nbclient==0.5.13
nbconvert==6.4.4
nbformat==5.3.0
nest-asyncio==1.5.5
notebook==6.4.11
numexpr==2.8.1
numpy==1.22.3
numpy-base==1.22.3
numpydoc==1.2
olefile==0.46
openjpeg==2.4.0
openssl==1.1.1p
packaging==21.3
pandas==1.4.2
pandocfilters==1.5.0
pango==1.42.4
paramiko==2.8.1
parso==0.8.3
pathspec==0.7.0
pcre==8.45
pexpect==4.8.0
pickleshare==0.7.5003
pillow==8.2.0
pip==22.1.2
pixman==0.38.0
plotly==5.4.0
pluggy==1.0.0
poyo==0.5.0
prometheus_client==0.13.1
prompt-toolkit==3.0.20
psutil==5.9.0
psycopg2==2.8.6
ptyprocess==0.7.0
pure_eval==0.2.2
pycodestyle==2.7.0
pycparser==2.21
pydantic==1.9.1
pydocstyle==6.1.1
pyflakes==2.3.1
pygments==2.11.2
pylint==2.9.6
pyls-spyder==0.4.0
pynacl==1.4.0
pyopenssl==22.0.0
pyparsing==3.0.4
pyphen==0.12.0
pyqt==5.9.2
pyrsistent==0.18.0
pysocks==1.7.1
python==3.8.13
python-dateutil==2.8.2
python-fastjsonschema==2.15.1
python-kaleido==0.2.1
python-lsp-black==1.0.0
python-lsp-jsonrpc==1.0.0
python-lsp-server==1.2.4
python-slugify==5.0.2
python_abi==3.8
pytz==2022.1
pywin32==302
pywin32-ctypes==0.2.0
pywinpty==2.0.2
pyyaml==6.0
pyzmq==22.3.0
qdarkstyle==3.0.2
qstylizer==0.1.10
qt==5.9.7
qtawesome==1.0.3
qtconsole==5.3.0
qtpy==2.0.1
regex==2022.3.15
requests==2.27.1
rope==0.22.0
rtree==0.9.7
send2trash==1.8.0
setuptools==61.2.0
sip==4.19.13
six==1.16.0
sniffio==1.2.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
soupsieve==2.3.1
sphinx==4.4.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
spyder==5.1.5
spyder-kernels==2.1.3
sqlite==3.38.5
stack_data==0.2.0
starlette==0.19.1
tenacity==8.0.1
terminado==0.13.1
testpath==0.6.0
text-unidecode==1.3
textdistance==4.2.1
three-merge==0.1.1
tinycss==0.4
tinycss2==1.1.1
tk==8.6.12
toml==0.10.2
tornado==6.1
traitlets==5.1.1
typed-ast==1.4.3
typing-extensions==4.1.1
typing_extensions==4.1.1
ujson==5.1.0
unidecode==1.2.0
urllib3==1.26.9
uvicorn==0.17.6
vc==14.2
vs2015_runtime==14.27.29016
watchdog==2.1.6
wcwidth==0.2.5
weasyprint==52.5
webencodings==0.5.1
wheel==0.37.1
win_inet_pton==1.1.0
wincertstore==0.2
winpty==0.4.3
wrapt==1.12.1
xz==5.2.5
yaml==0.2.5
yapf==0.31.0
zipp==3.8.0
zlib==1.2.12
zstd==1.5.0

CodePudding user response:

One or mode of the dependencies can't be found from pip. I suggest you to look on PyPi for every dependency in the requirements.txt and to try to remember if you had to manually install one of those libraries in a particular way. Also, try cleaning up the file. I don't think those are all used in your project. If you work without venvs, you will get every library installed for every previous project when doing pip freeze. I mean, it's very strange for you to need pyqt in a dockerized application.

  • Related