我有一个脚本,我正在使用fbconsole和twitter.这些脚本可以自行运行.
对于GUI部分,我正在尝试使用Kivy.现在,当我导入我的脚本时,我收到错误ImportError,说没有名为twitter/fbconsole的模块.我该怎么办?
我检查了运行kivy应用程序时显示的路径.这是完整的日志
botstrapping Kivy @ C:\Users\roy\Desktop\Kivy-1.7.2-w32\ Setting Environment Variables: ################################# GST_REGISTRY C:\Users\roy\Desktop\Kivy-1.7.2-w32\gstreamer\registry.bin --------------- GST_PLUGIN_PATH: C:\Users\roy\Desktop\Kivy-1.7.2-w32\gstreamer\lib\gstreamer-0.10 --------------- PATH: C:\Users\roy\Desktop\Kivy-1.7.2-w32\;C:\Users\roy\Desktop\Kivy-1.7.2-w32\Python; C:\Users\roy\Desktop\Kivy-1.7.2-w32\Python\Scripts;C:\Users\roy\Desktop\Kivy-1.7 .2-w32\gstreamer\bin;C:\Users\roy\Desktop\Kivy-1.7.2-w32\MinGW\bin;C:\Program Fi les (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Wind ows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\python27\;C:\Pr ogram Files (x86)\Java\jdk1.7.0\bin;C:\Python27\Scripts;C:\Users\roy\Desktop\Kiv y-1.7.2-w32;C:\Program Files (x86)\Google\google_appengine\;C:\Python27\Lib\site -packages\; ---------------------------------- PYTHONPATH: C:\Users\roy\Desktop\Kivy-1.7.2-w32\kivy; ---------------------------------- ################################## done bootstraping kivy...have fun!\n running "python.exe C:\Users\roy\Desktop\CSE310\merging\gui1.py" \n [INFO ] Kivy v1.7.2 Purge log fired. Analysing... Purge finished ! [INFO ] [Logger ] Record log in C:\Users\roy\.kivy\logs\kivy_1 3-12-26_25.txt [INFO ] [Factory ] 144 symbols loaded [DEBUG ] [Cache ] registerwith limit=None, timeout= Nones [DEBUG ] [Cache ] register with limit=None, timeout =60s [DEBUG ] [Cache ] register with limit=None, timeout =Nones [INFO ] [Image ] Providers: img_tex, img_dds, img_pygame, img _pil, img_gif [DEBUG ] [Cache ] register with limit=1000, timeo ut=60s [DEBUG ] [Cache ] register with limit=1000, timeou t=3600s [INFO ] [Text ] Provider: pygame [DEBUG ] [Cache ] register with limit=500, timeout =60s [INFO ] [Loader ] using a thread pool of 2 workers [DEBUG ] [Cache ] register with limit=None, timeout=60.0s [DEBUG ] [Cache ] register with limit=None, timeout=60.0s Traceback (most recent call last): File "C:\Users\roy\Desktop\CSE310\merging\gui1.py", line 9, in import twit File "C:\Users\roy\Desktop\CSE310\merging\twit.py", line 1, in from twitter import * ImportError: No module named twitter Press any key to continue . . .
Tshirtman.. 5
当您使用kivy的可移植软件包用于Windows时,您必须在随附的python安装中安装这些库.要做到这一点,你只需要启动kivy.bat,并在其中使用pip install
,以这种方式安装的库将可用于kivy应用程序.
替代解决方案是在系统范围内安装kivy,具有所有必需的依赖项.
当您使用kivy的可移植软件包用于Windows时,您必须在随附的python安装中安装这些库.要做到这一点,你只需要启动kivy.bat,并在其中使用pip install
,以这种方式安装的库将可用于kivy应用程序.
替代解决方案是在系统范围内安装kivy,具有所有必需的依赖项.