<i id='B6OC3'><tr id='B6OC3'><dt id='B6OC3'><q id='B6OC3'><span id='B6OC3'><b id='B6OC3'><form id='B6OC3'><ins id='B6OC3'></ins><ul id='B6OC3'></ul><sub id='B6OC3'></sub></form><legend id='B6OC3'></legend><bdo id='B6OC3'><pre id='B6OC3'><center id='B6OC3'></center></pre></bdo></b><th id='B6OC3'></th></span></q></dt></tr></i><div id='B6OC3'><tfoot id='B6OC3'></tfoot><dl id='B6OC3'><fieldset id='B6OC3'></fieldset></dl></div>
        <bdo id='B6OC3'></bdo><ul id='B6OC3'></ul>

      <small id='B6OC3'></small><noframes id='B6OC3'>

      <tfoot id='B6OC3'></tfoot>

        <legend id='B6OC3'><style id='B6OC3'><dir id='B6OC3'><q id='B6OC3'></q></dir></style></legend>
      1. 出现错误:没有名为“calendar_ui"的模块.即使

        时间:2023-10-08
          <tbody id='pVRXb'></tbody>
        • <bdo id='pVRXb'></bdo><ul id='pVRXb'></ul>

          • <tfoot id='pVRXb'></tfoot>

              • <legend id='pVRXb'><style id='pVRXb'><dir id='pVRXb'><q id='pVRXb'></q></dir></style></legend>

                <small id='pVRXb'></small><noframes id='pVRXb'>

              • <i id='pVRXb'><tr id='pVRXb'><dt id='pVRXb'><q id='pVRXb'><span id='pVRXb'><b id='pVRXb'><form id='pVRXb'><ins id='pVRXb'></ins><ul id='pVRXb'></ul><sub id='pVRXb'></sub></form><legend id='pVRXb'></legend><bdo id='pVRXb'><pre id='pVRXb'><center id='pVRXb'></center></pre></bdo></b><th id='pVRXb'></th></span></q></dt></tr></i><div id='pVRXb'><tfoot id='pVRXb'></tfoot><dl id='pVRXb'><fieldset id='pVRXb'></fieldset></dl></div>
                  本文介绍了出现错误:没有名为“calendar_ui"的模块.即使 KivyCalendar 已在 Windows 10 中使用 pip 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  KivyCalendar 已在 windows 10 中使用 pip 安装.但返回错误:-

                  KivyCalendar has been installed using pip in windows 10. But returns an error:-

                  没有名为calendar_ui"的模块

                  No module named 'calendar_ui

                  我的代码是:

                  from kivy.app import App
                  from KivyCalendar import CalendarWidget
                  
                  
                  class MyApp(App):
                  
                      def build(self):
                          return CalendarWidget()
                  
                  MyApp().run()
                  

                  任何帮助将不胜感激.谢谢

                  Any help would be much appreciated. Thanks

                  推荐答案

                  我在项目中使用 KivyCalendar 时遇到了一些问题,因此我做了一些改进以使其在 Python 3 上运行.确保有原始文件的副本.

                  I had a few troubles using KivyCalendar in my project so I made a few improvements to make it work on Python 3. Make sure to have a copy of original files.

                  添加行首带有 + 标记的行并删除行首带有 - 标记的文件.

                  Add lines which are having a + mark at the beginning of the line and remove files which are having a - mark at the beginning of the line.

                  首先找到kivycalendar的安装目录.

                  First of all find the directory where kivycalendar is installed.

                  KivyCalendar/init.py

                  KivyCalendar/init.py

                   #!/usr/bin/python
                   # -*- coding: utf-8 -*-
                  
                   -from calendar_ui import DatePicker, CalendarWidget
                   +from .calendar_ui import DatePicker, CalendarWidget
                  

                  KivyCalendar/calendar_data.py

                  KivyCalendar/calendar_data.py

                  -from calendar import TimeEncoding, month_name, day_abbr, Calendar, monthrange
                  +from calendar import month_name, day_abbr, Calendar, monthrange
                   from datetime import datetime
                   from locale import getdefaultlocale
                  +import locale as _locale
                  +
                  +
                  +class TimeEncoding:
                  +    def __init__(self, locale):
                  +        self.locale = locale
                  +
                  +    def __enter__(self):
                  +        self.oldlocale = _locale.setlocale(_locale.LC_TIME, self.locale)
                  +        return _locale.getlocale(_locale.LC_TIME)[1]
                  +
                  +    def __exit__(self, *args):
                  +        _locale.setlocale(_locale.LC_TIME, self.oldlocale)
                  +
                  
                   def get_month_names():
                       """ Return list with months names """
                  

                  KivyCalendar/calendar_ui.py

                  KivyCalendar/calendar_ui.py

                   from kivy.core.window import Window
                   from kivy.properties import NumericProperty, ReferenceListProperty
                  
                  -import calendar_data as cal_data
                  +from . import calendar_data as cal_data
                   ###########################################################
                   Builder.load_string("""
                   <ArrowButton>:
                  

                  这篇关于出现错误:没有名为“calendar_ui"的模块.即使 KivyCalendar 已在 Windows 10 中使用 pip 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Kivy - 单击按钮时编辑标签 下一篇:Kivy - windows - 根本找不到任何有价值的窗口提供程

                  相关文章

                  最新文章

                  <small id='xNYd2'></small><noframes id='xNYd2'>

                    • <bdo id='xNYd2'></bdo><ul id='xNYd2'></ul>

                      <i id='xNYd2'><tr id='xNYd2'><dt id='xNYd2'><q id='xNYd2'><span id='xNYd2'><b id='xNYd2'><form id='xNYd2'><ins id='xNYd2'></ins><ul id='xNYd2'></ul><sub id='xNYd2'></sub></form><legend id='xNYd2'></legend><bdo id='xNYd2'><pre id='xNYd2'><center id='xNYd2'></center></pre></bdo></b><th id='xNYd2'></th></span></q></dt></tr></i><div id='xNYd2'><tfoot id='xNYd2'></tfoot><dl id='xNYd2'><fieldset id='xNYd2'></fieldset></dl></div>
                      <tfoot id='xNYd2'></tfoot>

                    1. <legend id='xNYd2'><style id='xNYd2'><dir id='xNYd2'><q id='xNYd2'></q></dir></style></legend>