1
votes
import requests
r = requests.get('http://bbs.byr.cn/')
print r

The error:

Traceback (most recent call last): File "E:\MyPythonRoad\src\requeststest.py", line 1, in import requests File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests__init__.py", line 58, in from . import utils File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\utils.py", line 25, in from .compat import parse_http_list as _parse_list_header File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\compat.py", line 7, in from .packages import chardet File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\packages__init__.py", line 3, in from . import urllib3 File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\packages\urllib3__init__.py", line 16, in from .connectionpool import ( File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\packages\urllib3\connectionpool.py", line 36, in from .connection import ( File "C:\Python27\lib\site-packages\requests-2.3.0-py2.7.egg\requests\packages\urllib3\connection.py", line 43, in from .util import ( ImportError: No module named util

1
Go to /Library/Python/2.7/site-packages/requests-2.1.0-py2.7.egg/requests/packages/urllib3 and check to see if util.py is there.A.J. Uppal
It's not included util.py,how should I do next? THX.zhongwuzw

1 Answers

1
votes

requests

Since you are using Windows, you may want to try to reinstall requests through this binary.

urllib3

According to this, you may want to try manual download the util folder from urilib3 from the download at the bottom of pypi, and add it to the urllib3 install location.