scrapyd-deploy error: pkg_resources.DistributionNotFound: The ‘idna<3,>=2.5’ distribution was not found and is required by requests

  docker, python, scrapy, scrapyd

I have been trying for a long time to find a solution to the scrapyd error message: pkg_resources.DistributionNotFound: The ‘idna<3,>=2.5’ distribution was not found and is required by requests

What I have done:

$ docker pull ceroic/scrapyd
$ docker build -t scrapyd .

Dockerfile:

FROM ceroic/scrapyd
RUN pip install "idna==2.5"

$ docker build -t scrapyd .
Sending build context to Docker daemon 119.3kB
Step 1/2 : FROM ceroic/scrapyd
—> 868dca3c4d94
Step 2/2 : RUN pip install "idna==2.5"
—> Running in c0b6f6f73cf1
Downloading/unpacking idna==2.5
Installing collected packages: idna
Successfully installed idna
Cleaning up…
Removing intermediate container c0b6f6f73cf1
—> 849200286b7a
Successfully built 849200286b7a
Successfully tagged scrapyd:latest

I run the container:
$ docker run -d -p 6800:6800 scrapyd
Next:
scrapyd-deploy demo -p tutorial
And get error:
pkg_resources.DistributionNotFound: The ‘idna<3,>=2.5’ distribution was not found and is required by requests

I’m not a Docker expert, and I don’t understand the logic. If idna==2.5 has been successfully installed inside the container, why does the error message require version ‘idna<3,>=2.5’?

Source: Docker Questions

LEAVE A COMMENT