Python未解决的进口请求
我有一个非常令人沮丧的问题。我想运行这个简单的脚本,但我不能,因为请求
尚未安装,但它是。我正在使用Visual Studio 2019,我对Python一无所知。通常我正在使用C#编程。
from pprint import pprint
import requests
URL = 'https://discosweb.esoc.esa.int'
token = '<token>'
response = requests.get(
f'{URL}/api/objects',
headers={
'Authorization': f'Bearer {token}',
'DiscosWeb-Api-Version': '2',
},
params={
'filter': "eq(objectClass,Payload)>(reentry.epoch,epoch:'2020-01-01')",
'sort': '-reentry.epoch',
},
)
doc = response.json()
if response.ok:
pprint(doc['data'])
else:
pprint(doc['errors']))
I have a very frustrating problem. I want to run this simple script but I can't because requests
is not installed but it is. I am using Visual Studio 2019 and I have no clue about Python. Normally I am programming with C#.
from pprint import pprint
import requests
URL = 'https://discosweb.esoc.esa.int'
token = '<token>'
response = requests.get(
f'{URL}/api/objects',
headers={
'Authorization': f'Bearer {token}',
'DiscosWeb-Api-Version': '2',
},
params={
'filter': "eq(objectClass,Payload)>(reentry.epoch,epoch:'2020-01-01')",
'sort': '-reentry.epoch',
},
)
doc = response.json()
if response.ok:
pprint(doc['data'])
else:
pprint(doc['errors']))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如错误消息所建议的那样,很自然地怀疑您没有 python package
请求
已安装。您可能想看一下此Visual Studio教程用于Python软件包安装:)As suggested by the error message, it is natural to suspect that you don't have the Python package
requests
installed. You might want to take a look at this Visual Studio tutorial for Python package installation :)