How to fix the error with the library requests?

Welcome!
Pass rate on Stepik and experimenting with library requests. Everything was fine, but at some point in any module when you call this library was to occur some error:
zz@zz-Inspiron-5720:~/projects-pthn/stepik2$ python3 req.py
['928', '929', '994', '901', '965', '967', '998', '943', '976', '946', '950', '985', '924', '989', '991']
Traceback (most recent call last):
 File "req.py", line 1, in <module>
 import requests
 File "/home/zz/.local/lib/python3.6/site-packages/requests/__init__.py", line 112, in <module>
 from . import utils
 File "/home/zz/.local/lib/python3.6/site-packages/requests/utils.py", line 26, in <module>
 from ._internal_utils import to_native_string
 File "/home/zz/.local/lib/python3.6/site-packages/requests/_internal_utils.py", line 11, in <module>
 from .compat import is_py2, builtin_str, str
 File "/home/zz/.local/lib/python3.6/site-packages/requests/compat.py", line 29, in <module>
 import simplejson as json
 File "/usr/lib/python3/dist-packages/simplejson/__init__.py", line 110, in <module>
 from decimal import Decimal
 File "/usr/lib/python3.6/decimal.py", line 3, in <module>
 from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

Here is my Python code, but this error occurs when you call any file that is imported requests:
import requests

res = requests.get('https://yandex.ru')
print(res.status_code)
print(res.headers['Content-Type'])

I can assume that it's some kind of preserved cache, but how to cope I'll never know. Ubuntu 18.03. How to solve this problem?
March 12th 20 at 07:59
0 answer

Find more questions by tags Python