Funny error message

Barry Scott barry at barrys-emacs.org
Fri Jan 1 11:56:21 EST 2021



> On 1 Jan 2021, at 16:50, Bob van der Poel <bob at mellowood.ca> wrote:
> 
> On Thu, Dec 31, 2020 at 9:25 PM DL Neil via Python-list <
> python-list at python.org <mailto:python-list at python.org>> wrote:
> 
>> 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
>> 
>> 
> Found it!
> 
> I had the proper urllib3 installed. But, in my .local/lib/ a previous
> version was installed. Removing .local/lib/python3.8 has resolved the
> problem.
> 
> Anyone hazard a guess as to why I had a .local tree (nope, I did not create
> it ... I don't think!).
> 

That is where "python3.8 -m pip install --user" puts the packages you install.

Barry


> 
> -- 
> 
> **** Listen to my FREE CD at http://www.mellowood.ca/music/cedars <http://www.mellowood.ca/music/cedars> ****
> Bob van der Poel ** Wynndel, British Columbia, CANADA **
> EMAIL: bob at mellowood.ca <mailto:bob at mellowood.ca>
> WWW:   http://www.mellowood.ca <http://www.mellowood.ca/>
> -- 
> https://mail.python.org/mailman/listinfo/python-list <https://mail.python.org/mailman/listinfo/python-list>


More information about the Python-list mailing list