我正试图使用命令($python3es7.py)在Ubuntu服务器上运行python命令。 但是得到了错误(ModuleNotFoundError:No module name'confluent\u kafka')。你知道吗
我的es7.py脚本
from confluent_kafka import Producer
import json
import requests
import time
p = Producer({"bootstrap_servers": "localhost:9092"})
while True:
response1 = requests.get("http://api.openweathermap.org/data/2.5/weather?q=jaipur&appid=**")
p.produce('weather', key='jaipur', value=response1.text)
您似乎没有在ubuntu服务器上安装必要的依赖项(confluent\u kafka)。先安装。你知道吗
您可以通过以下方式安装:
如here所述。你知道吗
相关问题 更多 >
编程相关推荐