Funny error message

DL Neil PythonList at DancesWithMice.info
Thu Dec 31 23:25:24 EST 2020


On 1/1/21 11:46 AM, Bob van der Poel wrote:
> When I run python from the command line and generate an error I get the
> following:
> 
> Python 3.8.5 (default, Jul 28 2020, 12:59:40)
> [GCC 9.3.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
>>>> z
> /home/bob/.local/lib/python3.8/site-packages/requests/__init__.py:89:
> RequestsDependencyWarning: urllib3 (1.24.3) or chardet (4.0.0) doesn't
> match a supported version!
>   warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name 'z' is not defined
> 
> I understand "z in not defined" ... but what's with the warnings?


The implication is that there is a version-mismatch between Python 3.8
and whichever urllib3 and chardet libraries currently installed.

Recommend updating the system, container, or venv: either Python, pip3
of the two and/or requests or html-parser [as appropriate to the
installed libraries - see below], or both/all.


System here runs as-expected:

dn $ ... python
Python 3.9.1 (default, Dec  8 2020, 00:00:00)
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> z
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'z' is not defined
>>> import chardet
>>> import urllib3
>>> exit()
dn $ ... pip show chardet urllib3
Name: chardet
Version: 3.0.4
Summary: Universal encoding detector for Python 2 and 3
Home-page: https://github.com/chardet/chardet
Author: Mark Pilgrim
Author-email: mark at diveintomark.org
License: LGPL
Location: /usr/lib/python3.9/site-packages
Requires:
Required-by: html5-parser, requests
---
Name: urllib3
Version: 1.25.8
Summary: HTTP library with thread-safe connection pooling, file post,
and more.
Home-page: https://urllib3.readthedocs.io/
Author: Andrey Petrov
Author-email: andrey.petrov at shazow.net
License: MIT
Location: /usr/lib/python3.9/site-packages
Requires:
Required-by: requests

-- 
Regards =dn


More information about the Python-list mailing list