practical-recommender-systems / moviegeek

A django website used in the book Practical Recommender Systems to illustrate how recommender algorithms can be implemented.
MIT License
901 stars 360 forks source link

Docker build fails :( #71

Open aliwo opened 1 year ago

aliwo commented 1 year ago

Hi! thanks for making great book 👍

but... I think docker build fails on latest master I'm on mac os monterey 12.3

docker-compose build web
[+] Building 175.8s (10/11)                                                                                                                                                                                                                   
 => [internal] load build definition from Dockerfile                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 189B                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/python:3.8                                                                                                                                                                            4.0s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                                                                                            0.0s
 => [1/6] FROM docker.io/library/python:3.8@sha256:f9af3c8c4614d955495d23a665760abe3b37d4310bf9c33ea1ebf9f18991d8fe                                                                                                                     92.8s
 => => resolve docker.io/library/python:3.8@sha256:f9af3c8c4614d955495d23a665760abe3b37d4310bf9c33ea1ebf9f18991d8fe                                                                                                                      0.0s
 => => sha256:f9af3c8c4614d955495d23a665760abe3b37d4310bf9c33ea1ebf9f18991d8fe 1.86kB / 1.86kB                                                                                                                                           0.0s
 => => sha256:fa2a4081e81d2ac65a9e622ede295f84e18cb0359a588bbea4105dd69faf7bfd 2.22kB / 2.22kB                                                                                                                                           0.0s
 => => sha256:8022b074731d9ecee7f4fba79b993920973811dda168bbc08636f18523b90122 53.70MB / 53.70MB                                                                                                                                        43.4s
 => => sha256:91a934163d324049bba626dc29942dc17df1ee0646c8491ec08339e6c0fa06c7 7.95kB / 7.95kB                                                                                                                                           0.0s
 => => sha256:7971239fe1d69763272ccc0b2527efa95547d37c53630ed0a71db4e00d3ef964 5.15MB / 5.15MB                                                                                                                                           3.6s
 => => sha256:26c861b53509d61c37240d2f80efb3a351d2f1d7f4f8e8ec2e5004c1d86af89c 10.87MB / 10.87MB                                                                                                                                        12.1s
 => => sha256:1714880ecc1c021a5f708f4369f91d3c2c53b998a56d563d0a9aa9be2488d794 54.68MB / 54.68MB                                                                                                                                        38.0s
 => => sha256:895a945a1f9ba441c2748501c4d46569edfbc2bfbdb9b47d41e753e752247fdc 189.73MB / 189.73MB                                                                                                                                      87.2s
 => => sha256:2a83fe9e3053a5f52e699f1078c2abeaad849bb81da9068f1aa541bb5673a21f 6.40MB / 6.40MB                                                                                                                                          42.5s
 => => sha256:9fab1e817d7e301293133a70df52de98c881db200f6a87c508354aba37c202ab 15.47MB / 15.47MB                                                                                                                                        47.8s
 => => extracting sha256:8022b074731d9ecee7f4fba79b993920973811dda168bbc08636f18523b90122                                                                                                                                                1.7s
 => => sha256:a5cd1ca01318d087b11fd017b43646eabfeea1199d9c088c9d93c09118cc4b94 244B / 244B                                                                                                                                              43.7s
 => => sha256:24c24e538c8de9c742de4d3d71ecb4bf81f5748f9c79c246517856eaa0e63f83 2.91MB / 2.91MB                                                                                                                                          47.8s
 => => extracting sha256:7971239fe1d69763272ccc0b2527efa95547d37c53630ed0a71db4e00d3ef964                                                                                                                                                0.2s
 => => extracting sha256:26c861b53509d61c37240d2f80efb3a351d2f1d7f4f8e8ec2e5004c1d86af89c                                                                                                                                                0.3s
 => => extracting sha256:1714880ecc1c021a5f708f4369f91d3c2c53b998a56d563d0a9aa9be2488d794                                                                                                                                                2.1s
 => => extracting sha256:895a945a1f9ba441c2748501c4d46569edfbc2bfbdb9b47d41e753e752247fdc                                                                                                                                                4.5s
 => => extracting sha256:2a83fe9e3053a5f52e699f1078c2abeaad849bb81da9068f1aa541bb5673a21f                                                                                                                                                0.2s
 => => extracting sha256:9fab1e817d7e301293133a70df52de98c881db200f6a87c508354aba37c202ab                                                                                                                                                0.4s
 => => extracting sha256:a5cd1ca01318d087b11fd017b43646eabfeea1199d9c088c9d93c09118cc4b94                                                                                                                                                0.0s
 => => extracting sha256:24c24e538c8de9c742de4d3d71ecb4bf81f5748f9c79c246517856eaa0e63f83                                                                                                                                                0.1s
 => [internal] load build context                                                                                                                                                                                                       38.2s
 => => transferring context: 349.84MB                                                                                                                                                                                                   38.1s
 => [2/6] RUN mkdir /code                                                                                                                                                                                                                0.5s
 => [3/6] WORKDIR /code                                                                                                                                                                                                                  0.0s
 => [4/6] COPY requirements.txt /code/                                                                                                                                                                                                   0.0s
 => ERROR [5/6] RUN pip install -r requirements.txt                                                                                                                                                                                     78.2s
------
 > [5/6] RUN pip install -r requirements.txt:
#0 1.107 Collecting appdirs==1.4.3
#0 1.170   Downloading appdirs-1.4.3-py2.py3-none-any.whl (12 kB)
#0 1.198 Collecting boto==2.49.0
#0 1.211   Downloading boto-2.49.0-py2.py3-none-any.whl (1.4 MB)
#0 1.455      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 5.8 MB/s eta 0:00:00
#0 1.765 Collecting boto3==1.9.45
#0 1.861   Downloading boto3-1.9.45-py2.py3-none-any.whl (128 kB)
#0 1.880      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 128.5/128.5 KB 8.7 MB/s eta 0:00:00
#0 2.272 Collecting botocore==1.12.45
#0 2.283   Downloading botocore-1.12.45-py2.py3-none-any.whl (4.8 MB)
#0 3.706      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.8/4.8 MB 3.4 MB/s eta 0:00:00
#0 3.969 Collecting bz2file==0.98
#0 4.001   Downloading bz2file-0.98.tar.gz (11 kB)
#0 4.010   Preparing metadata (setup.py): started
#0 4.211   Preparing metadata (setup.py): finished with status 'done'
#0 4.238 Collecting certifi==2018.10.15
#0 4.250   Downloading certifi-2018.10.15-py2.py3-none-any.whl (146 kB)
#0 4.277      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 146.3/146.3 KB 5.5 MB/s eta 0:00:00
#0 4.295 Collecting chardet==3.0.4
#0 4.330   Downloading chardet-3.0.4-py2.py3-none-any.whl (133 kB)
#0 4.371      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.4/133.4 KB 3.4 MB/s eta 0:00:00
#0 4.397 Collecting cycler==0.10.0
#0 4.441   Downloading cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
#0 4.525 Collecting Django==2.2.27
#0 4.570   Downloading Django-2.2.27-py3-none-any.whl (7.5 MB)
#0 7.795      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 2.3 MB/s eta 0:00:00
#0 7.854 Collecting django-extensions==2.1.3
#0 8.196   Downloading django_extensions-2.1.3-py2.py3-none-any.whl (216 kB)
#0 8.326      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 216.4/216.4 KB 1.7 MB/s eta 0:00:00
#0 8.361 Collecting docutils==0.14
#0 8.396   Downloading docutils-0.14-py3-none-any.whl (543 kB)
#0 8.677      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 543.2/543.2 KB 1.9 MB/s eta 0:00:00
#0 8.998 Collecting gensim==3.6.0
#0 9.010   Downloading gensim-3.6.0.tar.gz (23.1 MB)
#0 17.28      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.1/23.1 MB 3.5 MB/s eta 0:00:00
#0 17.67   Preparing metadata (setup.py): started
#0 25.31   Preparing metadata (setup.py): finished with status 'done'
#0 25.34 Collecting idna==2.7
#0 25.35   Downloading idna-2.7-py2.py3-none-any.whl (58 kB)
#0 25.37      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.2/58.2 KB 6.1 MB/s eta 0:00:00
#0 25.39 Collecting jmespath==0.9.3
#0 25.40   Downloading jmespath-0.9.3-py2.py3-none-any.whl (23 kB)
#0 25.49 Collecting kiwisolver==1.0.1
#0 25.50   Downloading kiwisolver-1.0.1.tar.gz (31 kB)
#0 25.52   Preparing metadata (setup.py): started
#0 25.62   Preparing metadata (setup.py): finished with status 'done'
#0 25.79 Collecting matplotlib==3.0.2
#0 25.80   Downloading matplotlib-3.0.2.tar.gz (36.5 MB)
#0 44.07      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36.5/36.5 MB 2.0 MB/s eta 0:00:00
#0 45.03   Preparing metadata (setup.py): started
#0 46.20   Preparing metadata (setup.py): finished with status 'done'
#0 46.35 Collecting numpy==1.22.2
#0 46.37   Downloading numpy-1.22.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.4 MB)
#0 52.46      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.4/13.4 MB 2.2 MB/s eta 0:00:00
#0 52.66 Collecting pandas==1.4.1
#0 52.68   Downloading pandas-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (11.0 MB)
#0 56.84      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.0/11.0 MB 2.6 MB/s eta 0:00:00
#0 56.90 Collecting packaging==16.8
#0 56.91   Downloading packaging-16.8-py2.py3-none-any.whl (23 kB)
#0 56.96 Collecting pyparsing==2.3.0
#0 56.96   Downloading pyparsing-2.3.0-py2.py3-none-any.whl (59 kB)
#0 56.98      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.0/59.0 KB 7.8 MB/s eta 0:00:00
#0 57.00 Collecting python-dateutil==2.8.2
#0 57.04   Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
#0 57.12      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 3.3 MB/s eta 0:00:00
#0 57.18 Collecting pytz==2021.3
#0 57.20   Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
#0 57.50      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.5/503.5 KB 1.6 MB/s eta 0:00:00
#0 57.61 Collecting requests==2.20.1
#0 57.62   Downloading requests-2.20.1-py2.py3-none-any.whl (57 kB)
#0 57.63      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.0/58.0 KB 4.8 MB/s eta 0:00:00
#0 57.65 Collecting s3transfer==0.1.13
#0 57.66   Downloading s3transfer-0.1.13-py2.py3-none-any.whl (59 kB)
#0 57.69      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.6/59.6 KB 2.1 MB/s eta 0:00:00
#0 57.85 Collecting scipy==1.8.0
#0 57.86   Downloading scipy-1.8.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (39.0 MB)
#0 75.04      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 39.0/39.0 MB 2.5 MB/s eta 0:00:00
#0 75.12 Collecting seaborn==0.8.1
#0 75.13   Downloading seaborn-0.8.1.tar.gz (178 kB)
#0 75.27      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.9/178.9 KB 1.3 MB/s eta 0:00:00
#0 75.29   Preparing metadata (setup.py): started
#0 75.39   Preparing metadata (setup.py): finished with status 'done'
#0 75.41 Collecting six==1.11.0
#0 75.42   Downloading six-1.11.0-py2.py3-none-any.whl (10 kB)
#0 75.44 Collecting sklearn==0.0
#0 75.45   Downloading sklearn-0.0.tar.gz (1.1 kB)
#0 75.46   Preparing metadata (setup.py): started
#0 75.56   Preparing metadata (setup.py): finished with status 'done'
#0 75.80 Collecting smart-open==1.7.1
#0 75.82   Downloading smart_open-1.7.1.tar.gz (38 kB)
#0 75.83   Preparing metadata (setup.py): started
#0 75.94   Preparing metadata (setup.py): finished with status 'done'
#0 76.18 Collecting stop-words==2015.2.23.1
#0 76.33   Downloading stop-words-2015.2.23.1.tar.gz (18 kB)
#0 76.34   Preparing metadata (setup.py): started
#0 76.46   Preparing metadata (setup.py): finished with status 'done'
#0 76.53 Collecting tqdm==4.28.1
#0 76.54   Downloading tqdm-4.28.1-py2.py3-none-any.whl (45 kB)
#0 76.55      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 KB 4.4 MB/s eta 0:00:00
#0 76.59 Collecting urllib3==1.26.5
#0 76.60   Downloading urllib3-1.26.5-py2.py3-none-any.whl (138 kB)
#0 76.63      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 138.1/138.1 KB 5.0 MB/s eta 0:00:00
#0 76.90 Collecting pyLDAvis==2.1.1
#0 76.92   Downloading pyLDAvis-2.1.1.tar.gz (1.6 MB)
#0 77.52      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 2.7 MB/s eta 0:00:00
#0 77.59   Preparing metadata (setup.py): started
#0 77.72   Preparing metadata (setup.py): finished with status 'done'
#0 77.81 INFO: pip is looking at multiple versions of boto3 to determine which version is compatible with other requirements. This could take a while.
#0 77.81 INFO: pip is looking at multiple versions of boto to determine which version is compatible with other requirements. This could take a while.
#0 77.81 INFO: pip is looking at multiple versions of appdirs to determine which version is compatible with other requirements. This could take a while.
#0 77.81 ERROR: Cannot install -r requirements.txt (line 4) and urllib3==1.26.5 because these package versions have conflicting dependencies.
#0 77.81 
#0 77.81 The conflict is caused by:
#0 77.81     The user requested urllib3==1.26.5
#0 77.81     botocore 1.12.45 depends on urllib3<1.25 and >=1.20; python_version >= "3.4"
#0 77.81 
#0 77.81 To fix this you could try to:
#0 77.81 1. loosen the range of package versions you've specified
#0 77.81 2. remove package versions to allow pip attempt to solve the dependency conflict
#0 77.81 
#0 77.81 ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
#0 77.91 WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
#0 77.91 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
------
failed to solve: executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
rithysokun commented 7 months ago

the conflict is with the urllib3 and dependency conflict of botocore depend on urllib3 ver < 1.25 . Try installing lower version of urllib3

swontroba commented 6 months ago

At the end what worked for me was not to use the latest python / using now a 3.8.x worked fine for me with the other adaption mentioned. documenting it here for someone who might also search for a solution.