requests dependency warning

nxfi777PRO

a year 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

nxfi777PRO

a year ago

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


nxfi777PRO

a year ago

@Brody any ideas?


a year ago

why are you installing python from apt?


nxfi777PRO

a year ago

its a sandbox


a year ago

not too sure how that answers the question


nxfi777PRO

a year ago

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


a year ago

okay now that answers the question


a year ago

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


nxfi777PRO

a year ago

1228730239509729300


a year ago

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


nxfi777PRO

a year ago

The pypi page doesnt have the latest version recorded?


nxfi777PRO

a year ago

python print(requests.__version__)


nxfi777PRO

a year ago

outputs: 2.31.0


a year ago

well you are installing something that isnt compatible with something else


nxfi777PRO

a year ago

it may be an omitted package ^


nxfi777PRO

a year ago

but theres so many 😭


a year ago

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


nxfi777PRO

a year ago

ok


nxfi777PRO

a year ago

Upgrading pip before installing requirements solved the issue


a year ago

awesome