I'm using the following code to get data from a REST API:
import requests
import json
key = "my service key"
api = "http://api.data.go.kr/openapi/pblprfr-event-info-std?serviceKey=", key, "&s_page=1&s_list=100&type=json"
r = requests.get(api)
data = json.loads(r.text)
print(data["행사명"])
This code produces the following error:
File "sel2.py", line 1, in <module>
import requests
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/init.py", line 46, in <module>
from .exceptions import RequestsDependencyWarning
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/exceptions.py", line 9, in <module>
from urllib3.exceptions import HTTPError as BaseHTTPError
ModuleNotFoundError: No module named 'urllib3.exceptions'; 'urllib3' is not a package
Any ideas what the problem can be?