Android应用程序在启动/导入时崩溃错误:没有名为请求的模块

Android应用程序在启动/导入时崩溃错误:没有名为请求的模块,android,python,kivy,Android,Python,Kivy,我在Windows上安装了请求,但我仍然运行命令pip install Requests。 我可以使用请求从服务器获取数据,所以我不知道为什么在启动我制作的应用程序时会出现这种错误。 我不确定,但我认为这可能是导致崩溃的原因,随后会触发: “查找窗口失败” java.lang.IllegalArgumentException:请求的窗口android.os。BinderProxy@e668ad1不存在 如何修复此问题并阻止我的应用程序立即崩溃 import requests import jso

我在Windows上安装了请求,但我仍然运行命令
pip install Requests
。 我可以使用请求从服务器获取数据,所以我不知道为什么在启动我制作的应用程序时会出现这种错误。 我不确定,但我认为这可能是导致崩溃的原因,随后会触发:

“查找窗口失败”

java.lang.IllegalArgumentException:请求的窗口android.os。BinderProxy@e668ad1不存在

如何修复此问题并阻止我的应用程序立即崩溃

import requests
import json
import matplotlib.pyplot as plt
import datetime
import time
from operator import itemgetter
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
from kivy.uix.boxlayout import BoxLayout
from kivy.app import App

class placeHolder():

    def getSession():
        #Access Server
        auth = requests.auth.HTTPBasicAuth('<secret>', '<secret>')
        r = requests.get('<secret>', auth=auth)
        user_info = r.json()
        r = requests.get('<secret>'.format(user_info['tanks'][0]), auth=auth)
        #print(json.loads(r.text))

        #Get the data we want
        data = []
        for i in range(len(json.loads(r.text))-5, len(json.loads(r.text))):
            important = json.loads(r.text)[i]["recorded_time"] + " " + json.loads(r.text)[i]["top_temperature"] + " " + \
                        json.loads(r.text)[i]["bottom_temperature"] + " " + json.loads(r.text)[i]["charge"]
            Data = important.split()
            data += [Data]
        return data


    def convertTime(data):
        #Need to order data so convert to unix
        for i in data:
            t = i[0] + " " + i[1]
            new_t = time.mktime(datetime.datetime.strptime(t, "%Y-%m-%d %H:%M:%S").timetuple())
            del i[0] #delete date
            del i[0] #now time is in 0th position, delete time
            i += [new_t]
        return data


    def orderTime(data):
        #Matplotlib needs the data to be ordered or it won't plot properly
        orderedData = sorted(data, key=itemgetter(3))
        return orderedData


    def plotData(dataToPlot):
        x = []
        yTop = []
        yBottom = []
        charge = []

        #Populate lists with data
        for i in dataToPlot:
            dateToStr = datetime.datetime.fromtimestamp(int(i[3])).strftime('%Y-%m-%d %H:%M:%S')
            date = datetime.datetime.strptime(dateToStr, "%Y-%m-%d %H:%M:%S")
            yTop += [i[0]] #top temp
            yBottom += [i[1]] #bottom temp
            charge += [i[2]]
            x += [date]

        #Plot Data
        ax = plt.gca()
        ax.set_ylim([0, 100])
        plt.title("Tank Data")
        plt.plot_date(x, yTop, "r-", label="Top Temp") # labels not working
        plt.plot_date(x, yBottom, "b-", label="Bottom Temp")
        plt.plot_date(x, charge, "y-",  label="Charge")
        plt.xlabel("Time")
        plt.ylabel("Temperature")
        plt.xticks(rotation=45)
        plt.subplots_adjust(left=0.12, bottom=0.20, right=0.90, top=0.88)
        plt.legend(loc="best", prop={'size':9})
        plt.grid(True, linestyle="-", linewidth=0.5)

        #plt.show() Without this it works in Kivy

    def stuff():
        #Cleaner to do this here instead of within the build function below
        sessionData = placeHolder.getSession()
        selectedData = placeHolder.convertTime(sessionData)
        toPlot = placeHolder.orderTime(selectedData)
        placeHolder.plotData(toPlot)
        box = BoxLayout()
        box.add_widget(FigureCanvasKivyAgg(plt.gcf()))
        return box

添加你的类代码你已经在Windows机器上安装了一些东西,并在Android设备/模拟器上运行了一个应用程序?如果这是你的意思,我已经发布了全部代码@OussemaAroua@0xDEADC0DE我用一个虚拟的盒子把这个放在我的手机上,然后我就运行pp,如果这是你的意思,你不能做什么?
def build(self):
    box = placeHolder.stuff()
    return box

if __name__== "__main__":
    Tank_GraphApp().run()