1
我安裝了Kivy lib,並一直試圖讓它整天工作。 我嘗試以下簡單的教程:無法導入名稱kivy_config_fn
import kivy
kivy.require('1.9.0')
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text='Hello world')
if __name__ == '__main__':
MyApp().run()
當試圖從文件中運行我得到以下錯誤:
Traceback (most recent call last):
File "random.py", line 1, in <module>
import kivy
File "C:\Python34\lib\site-packages\kivy\__init__.py", line 38, in <module>
from kivy.logger import Logger, LOG_LEVELS
File "C:\Python34\lib\site-packages\kivy\logger.py", line 61, in <module>
from random import randint
File "random.py", line 2, in <module>
from kivy.app import App
File "C:\Python34\lib\site-packages\kivy\app.py", line 315, in <module>
from kivy.config import ConfigParser
File "C:\Python34\lib\site-packages\kivy\config.py", line 272, in <module>
from kivy import kivy_config_fn
ImportError: cannot import name 'kivy_config_fn'
Press any key to continue . . .
令人困惑的是,它的工作原理在互動就好... (能建設類以及完全相同的代碼運行的應用程序)
注:
已經嘗試過來自here
功能重新安裝
安裝Kivy:
窗口8.1
Python 3中0.4
在此先感謝