[Kivy] ModuleNotFoundError: No module named 'kivy' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [Kivy] ModuleNotFoundError: No module named 'kivy' (/thread-17103.html) |
ModuleNotFoundError: No module named 'kivy' - Exsul - Mar-28-2019 I've installed Kivy to the specifications given in this documentation and this video, but when I try to run the following code, import kivy kivy.require('1.0.8') from kivy.app import App from kivy.uix.button import Label class HelloKivy(App): def build(self): return Label(text="Hello, Kivy.") helloKivy = HelloKivy() helloKivy.run()I get this error: Quote:Traceback (most recent call last): RE: ModuleNotFoundError: No module named 'kivy' - Larz60+ - Mar-29-2019 It may not be installed for the version of python that you are running run the following commands (from command line) to see where it's installed Since the link you show instructs you to use pip, make sure your pip is for your python version pip -V # and for python python -Vpip should show something like: if you see (python 2.7) in pip -V, and your python version is 3.whatever,then you need to reinstall using pip3 RE: ModuleNotFoundError: No module named 'kivy' - Exsul - Mar-29-2019 (Mar-29-2019, 02:35 AM)Larz60+ Wrote: It may not be installed for the version of python that you are running Okay, it's installed now, but when I tried to use it, I got a different module-not-found error: ModuleNotFoundError: No module named 'kivy.app'; 'kivy' is not a package Here is the code: import kivy from kivy.app import App from kivy.uix.label import Label class MyApp(App): def build(self): return Label(text="Text here") if __name__ == "__main__": MyApp().run() RE: ModuleNotFoundError: No module named 'kivy' - Yoriz - Mar-29-2019 Have you named one of your files kivy.py if so change to something different so it doesn't clash with the kivy files.
RE: ModuleNotFoundError: No module named 'kivy' - Exsul - Mar-29-2019 (Mar-29-2019, 06:17 AM)Yoriz Wrote: Have you named one of your files That may have been it, but now I'm back to this error again: ModuleNotFoundError: No module named 'kivy' Why is this so hard?! RE: ModuleNotFoundError: No module named 'kivy' - Exsul - Mar-29-2019 (Mar-29-2019, 02:35 AM)Larz60+ Wrote: It may not be installed for the version of python that you are running This was the result: C:\Users\[USERNAME]>pip -V pip 19.0.3 from c:\users\[USERNAME]\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7) C:\Users\[USERNAME]>python -V Python 3.7.3 RE: ModuleNotFoundError: No module named 'kivy' - Larz60+ - Mar-29-2019 Quote:This was the result:That looks fine. Please post exact, unmodified and complete error message that you are receiving also, what is your OS. RE: ModuleNotFoundError: No module named 'kivy' - Exsul - Mar-30-2019 (Mar-29-2019, 10:17 PM)Larz60+ Wrote:Quote:This was the result:That looks fine. Windows 10 (64-bit) Quote:C:\Users\travis.lambert\PycharmProjects\practice\venv\installkivy\Scripts\python.exe C:/Users/travis.lambert/PycharmProjects/kivia/venv/installkivy/never_name_a_file_kivy.py This problem is solved, but I still need help with the other. |