我试图在我的kivy项目中使用它,但继续得到这个keyerror。香港专业教育学院尝试了一种不同的麻烦拍摄东西,但我认为这里的人可能会有所帮助。
Nolans-MacBook-Pro:~ nolandonley$ kivy
/Users/nolandonley/Desktop/Kivy/main1.py
Purge log fired. Analysing...
Purge finished!
[INFO ] [Logger ] Record log in
/Applications/Kivy.app/Contents/Resources/.kivy/logs/kivy_18-05-28_32.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.5.0 (default, Jun 11 2017, 01:10:38)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.30.5)]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_imageio, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL ES 2" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <b'2.1 INTEL-10.32.48'>
[INFO ] [GL ] OpenGL vendor <b'Intel Inc.'>
[INFO ] [GL ] OpenGL renderer <b'Intel Iris Pro OpenGL Engine'>
[INFO ] [GL ] OpenGL parsed version: 2, 1
[INFO ] [GL ] Shading version <b'1.20'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <16>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
Traceback (most recent call last):
File "/Users/nolandonley/Desktop/Kivy/main1.py", line 17, in <module>
from kivy.garden.knob import Knob
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 636, in _load_backward_compatible
KeyError: 'kivy.garden.knob'
答案 0 :(得分:0)
我已经解决了我的问题,至少是暂时的。我不得不将knob.py文件移动到我的花园效果文件夹中,从那里导入,因为出于某种原因,从花园文件夹导入是一个问题。