0
0 комментариев
  1. 3.6.3
  2. CentOS 7
  3. import requests
  4. >>> import requests
    Traceback (most recent call last):
    File «<stdin>», line 1, in <module>
    File «/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/__init__.py», line 112, in <module>
    from . import utils
    File «/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/utils.py», line 26, in <module>
    from ._internal_utils import to_native_string
    File «/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/_internal_utils.py», line 11, in <module>
    from .compat import is_py2, builtin_str, str
    File «/opt/rh/rh-python36/root/usr/lib/python3.6/site-packages/requests/compat.py», line 59, in <module>
    from http import cookiejar as cookielib
    File «/opt/rh/rh-python36/root/usr/lib64/python3.6/http/cookiejar.py», line 31, in <module>
    import copy
    File «/opt/rh/rh-python36/root/usr/lib64/python3.6/copy.py», line 60, in <module>
    from org.python.core import PyStringMap
    File «/root/python/org.py», line 21, in <module>
    print(task.result())
    File «/opt/rh/rh-python36/root/usr/lib64/python3.6/concurrent/futures/_base.py», line 425, in result
    return self.__get_result()
    File «/opt/rh/rh-python36/root/usr/lib64/python3.6/concurrent/futures/_base.py», line 384, in __get_result
    raise self._exception
    File «/opt/rh/rh-python36/root/usr/lib64/python3.6/concurrent/futures/thread.py», line 56, in run
    result = self.fn(*self.args, **self.kwargs)
    File «/root/python/org.py», line 6, in download_file
    html = requests.get(url, stream=True)
    AttributeError: module ‘requests’ has no attribute ‘get’

Я не могу понять почему, но python категорически отказывается импортировать модули, который находятся в PIP list.

[root@2_cores python]# pip list
Package Version
————— ———
attrs 19.3.0
Automat 0.8.0
certifi 2019.9.11
chardet 3.0.4
constantly 15.1.0
hyperlink 19.0.0
idna 2.8
incremental 17.5.0
pip 19.3.1
PyHamcrest 1.9.0
requests 2.22.0
setuptools 36.5.0
six 1.13.0
Twisted 19.10.0
urllib3 1.25.7
virtualenv 15.1.0
zope.interface 4.7.1

[root@2_cores python]# pip3 list
Package Version
————— ———
attrs 19.3.0
Automat 0.8.0
certifi 2019.9.11
chardet 3.0.4
constantly 15.1.0
hyperlink 19.0.0
idna 2.8
incremental 17.5.0
pip 19.3.1
PyHamcrest 1.9.0
requests 2.22.0
setuptools 36.5.0
six 1.13.0
Twisted 19.10.0
urllib3 1.25.7
virtualenv 15.1.0
zope.interface 4.7.1

Asked question
Добавить комментарий