requests dependency warning
nxfi777
PROOP

2 years ago

I am running the project on Railway.

Warning:venv/lib/python3.11/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (2.2.1) or chardet (2.3.0)/charset_normalizer (3.3.2) doesn't match a supported version!

Environment: Docker, Ubuntu. Building from Dockerfile.

Relevant Dockerfile lines:

RUN apt-get update
RUN apt-get install -y python3 python3-pip python3-venv libcairo2-dev pkg-config python3-dev tesseract-ocr ffmpeg poppler-utils libportaudio2 swig libpulse-dev libpango1.0-dev
RUN apt-get clean

# Use the virtual environment
RUN python3 -m venv /usr/src/app/venv

# Install dependencies from requirements.txt
RUN /usr/src/app/venv/bin/pip install --no-cache-dir --upgrade --force-reinstall -r /usr/src/app/requirements.txt

Requirements:

wheel

# -- Problematic section --
requests
urllib3>=2.1.0
charset_normalizer
# -------------------------

Other requirements omitted for brevity.

The warning is shown regardless of whether the requests library is used.

Reading online, the consensus is that updating the requests library solves the problem, but I am using the latest version (2.31.0) and the warning is still there.

Originally, this was my pip install line in the Dockerfile:
RUN /usr/src/app/venv/bin/pip install --no-cache-dir -r /usr/src/app/requirements.txt

I added the --upgrade and --force-reinstall flags to no avail.

It could be an issue with a library I have omitted, but there are 95 in total and many are likely unrelated.

0 Replies

nxfi777
PROOP

2 years ago

b88cd4f4-3e33-4c82-8bb1-90877719ae87


nxfi777
PROOP

2 years ago

@Brody any ideas?


brody
EMPLOYEE

2 years ago

why are you installing python from apt?


nxfi777
PROOP

2 years ago

its a sandbox


brody
EMPLOYEE

2 years ago

not too sure how that answers the question


nxfi777
PROOP

2 years ago

using NodeJS for REST API and it opens a child subprocess using the installed python via apt


brody
EMPLOYEE

2 years ago

okay now that answers the question


brody
EMPLOYEE

2 years ago

after a quick google, looks like you may be installing an older version of requests


nxfi777
PROOP

2 years ago

1228730239509729300


brody
EMPLOYEE

2 years ago

yeah but im not too sure what the pypi page has to do with this


nxfi777
PROOP

2 years ago

The pypi page doesnt have the latest version recorded?


nxfi777
PROOP

2 years ago

python print(requests.__version__)


nxfi777
PROOP

2 years ago

outputs: 2.31.0


brody
EMPLOYEE

2 years ago

well you are installing something that isnt compatible with something else


nxfi777
PROOP

2 years ago

it may be an omitted package ^


nxfi777
PROOP

2 years ago

but theres so many 😭


brody
EMPLOYEE

2 years ago

try running pip install --upgrade requests in the dockerfile anyway


nxfi777
PROOP

2 years ago

ok


nxfi777
PROOP

2 years ago

Upgrading pip before installing requirements solved the issue


brody
EMPLOYEE

2 years ago

awesome


Loading...