简体   繁体   English

Python Pyler代码不起作用

[英]Python Pyler code not working

I have this code for pyler module in python kivy 我在python kivy中将此代码用于pyler模块

from kivy.app import App

from plyer.notification import notify

class AndroidApp(App):
    def build(self):
        notify('Some title', 'Some message text')

AndroidApp().run()

I have installed pyler and kivy from their github repositories, but still I get the following error message 我已经从他们的github仓库安装了pyler和kivy,但是仍然收到以下错误消息

Traceback (most recent call last): File "after.py", line 4, in from plyer.notification import notify ImportError: No module named notification 追溯(最近一次呼叫最近):来自plyer.notification import的文件“ after.py”,第4行,导入通知ImportError:没有名为通知的模块

I'm pretty sure I've installed pyler correctly, and I'm running this app on windows, and according to the docs, pyler notifications is available in windows too. 我敢肯定我已经正确安装了pyler,并且我正在Windows上运行此应用程序,并且根据文档,pyler通知在Windows中也可用。 Please help me solve this issue. 请帮我解决这个问题。

notification is defined as a variable in plyer/__init__.py . notificationplyer/__init__.py定义为变量。 It is not a module. 它不是一个模块。 import player.notification won't work. import player.notification无效。 You can use from plyer import notification instead. 您可以改用from plyer import notification

from plyer import notification
notification.notify

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM