ImportError: Нет модуля с именем запроса. Ошибка не приходит из моего кода - PullRequest
0 голосов
/ 03 мая 2020

Я пытаюсь импортировать пакет под названием PopularTime: https://github.com/m-wrzr/populartimes

Я продолжаю получать этот результат:

Traceback (most recent call last):
  File "scraper.py", line 1, in <module>
    import populartimes
  File "../site-packages/populartimes/__init__.py", line 4, in <module>
    from .crawler import run
  File "../site-packages/populartimes/crawler.py", line 12, in <module>
    import urllib.request
ImportError: No module named request

Кто-нибудь знает, как исправить эта проблема?

Когда я запускаю:

pip install requests

, я получаю:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: requests in /.../2.7/lib/python/site-packages (2.23.0)
Requirement already satisfied: idna<3,>=2.5 in /.../Python/2.7/lib/python/site-packages (from requests) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in /.../Python/2.7/lib/python/site-packages (from requests) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/aelsabagh/Library/Python/2.7/lib/python/site-packages (from requests) (1.25.9)
Requirement already satisfied: certifi>=2017.4.17 in /.../Python/2.7/lib/python/site-packages (from requests) (2020.4.5.1)

, а когда я запускаю:

pip install urllib3

, я получаю :

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: urllib3 in /.../Python/2.7/lib/python/site-packages (1.25.9)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...