I’ve installed Kivy and all the need files as far as I know, but I’m still getting this error message and I don’t know why.
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
class Container(GridLayout):
pass
class MainApp(App):
def build(self):
self.title = 'Awesome app!!!'
return Container()
if __name__ == "__main__":
app = MainApp()
app.run()
This is the error message I get:
Traceback (most recent call last):
File "C:UsersYassiOneDriveAfbeeldingenBureaubladmain.py", line 1, in <module>
from kivy.app import App
ImportError: No module named 'kivy'
I installed Kivy through anaconda, so the files for kivy might be installed in a wrong directory. Either way, I don’t know how to fix this problem.
I’m running this program on a Windows 10 OS and I use python-3
Edit: It might have something to do with how I refer to the python interpreter. I can’t find the location of the python interpreter though so now I’m stuck.
Edit2: This is the place where I installed python: C:Program FilesIBMSPSSStatistics25Python3. Any way how I can refer to this? I think this is where the problem lies.
I’ve installed kivy on my laptop using an installer from GitHub and everything was ok, I always run my code by CMD, I use Pycharm to code but I’ve never tried to run my code through it until moments ago. In Pycharm, configuration, python interpreter, I changed to «python 3.5(untitled)», Now my code runs in Pycharm, But I get following error in CMD:
C:UsersASUSDesktop>kivytest.py
Traceback (most recent call last):
File «C:UsersASUSDesktopkivytest.py», line 1, in
from kivy.app import App
ModuleNotFoundError: No module named ‘kivy’
I really need CMD, so what should I do now?!
Kirya002 0 / 0 / 0 Регистрация: 03.02.2017 Сообщений: 53 |
||||||||
1 |
||||||||
07.05.2017, 17:16. Показов 8663. Ответов 9 Метки нет (Все метки)
Решил освоить kivy app,установил через pip первые,вторые и третье указания.Вот код:
А вот,что у меня высвечивается:
Скажите,как мне исправить эту ошибку?Вот ссылка на kivy:https://kivy.org/docs/installa… ndows.html
0 |
5889 / 3347 / 1033 Регистрация: 03.11.2009 Сообщений: 9,974 |
|
07.05.2017, 18:11 |
2 |
Ну как говорится — одно из трех — или Вы не установили киви, или установили, но запускаете другим питоном.
0 |
0 / 0 / 0 Регистрация: 03.02.2017 Сообщений: 53 |
|
07.05.2017, 18:33 [ТС] |
3 |
Я пытался установить через pip установив перед этим cython и pygame,но вот что вышло и ошибка не исправилась:http://softport02.ulcraft.com/… 995472.png
0 |
103 / 81 / 54 Регистрация: 25.11.2016 Сообщений: 278 |
|
07.05.2017, 19:44 |
4 |
Скорее всего у вас не установлен Microsoft Visual C++
0 |
Kirya002 0 / 0 / 0 Регистрация: 03.02.2017 Сообщений: 53 |
||||
07.05.2017, 20:49 [ТС] |
7 |
|||
У меня python35 win32. Добавлено через 12 минут Добавлено через 8 минут
Скажите,как мне ее исправить?
0 |
Jabbson 5889 / 3347 / 1033 Регистрация: 03.11.2009 Сообщений: 9,974 |
||||
07.05.2017, 21:59 |
8 |
|||
импорты точно не ушли никуда? Добавлено через 1 минуту
0 |
0 / 0 / 0 Регистрация: 03.02.2017 Сообщений: 53 |
|
08.05.2017, 10:05 [ТС] |
9 |
Ну да,все так и осталось. Добавлено через 6 минут
0 |
10 / 9 / 3 Регистрация: 10.06.2013 Сообщений: 486 |
|
11.08.2021, 00:28 |
10 |
У меня похожая ошибка Traceback (most recent call last):
0 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
11.08.2021, 00:28 |
Помогаю со студенческими работами здесь Как открыть проект в Android Studio, состоящий из одного модуля app При запуске игры высвечивается ошибка Lvalue required почему высвечивается такая ошибка? Скачал VS2017 Community, на getline высвечивается ошибка
Есть кусок кода, который проверяет внесенный из формы текст на наличие… Ошибка kivy 1.9.1 Искать еще темы с ответами Или воспользуйтесь поиском по форуму: 10 |
Software Versions
- Python: 3.9.0
- OS: Windows 10
- Kivy: 2.0.0rc4
- Kivy installation method: Conda
Describe the bug
After installing Kivy using official documentation, Kivy fails to import.
Anaconda Prompt output:
(base) C:Usersmikolas>conda install kivy -c conda-forge
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.8.3
latest version: 4.9.2
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: C:Usersmikolasminiconda3
added / updated specs:
- kivy
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2020.11.8 | h5b45459_0 183 KB conda-forge
certifi-2020.11.8 | py38haa244fe_0 150 KB conda-forge
conda-4.9.2 | py38haa244fe_0 3.1 MB conda-forge
docutils-0.16 | py38h9bdc248_2 745 KB conda-forge
freetype-2.10.4 | h546665d_0 493 KB conda-forge
glew-2.1.0 | he025d50_0 824 KB conda-forge
jpeg-9d | h8ffe710_0 366 KB conda-forge
kivy-2.0.0rc4 | py38h7600b87_2 19.9 MB conda-forge
libpng-1.6.37 | h1d00b33_2 724 KB conda-forge
libtiff-4.1.0 | hc10be44_6 1.1 MB conda-forge
libwebp-1.0.2 | hfa6e2cd_5 356 KB conda-forge
lz4-c-1.9.2 | h62dcd97_2 279 KB conda-forge
olefile-0.46 | pyh9f0ad1d_1 32 KB conda-forge
openssl-1.1.1h | he774522_0 5.8 MB conda-forge
pillow-8.0.1 | py38hd8d9125_0 754 KB conda-forge
pygments-2.7.2 | py_0 707 KB conda-forge
python_abi-3.8 | 1_cp38 4 KB conda-forge
sdl2-2.0.12 | h0e60522_1 1.8 MB conda-forge
sdl2_image-2.0.5 | hb9708c9_2 213 KB conda-forge
sdl2_mixer-2.0.4 | h6538335_0 83 KB conda-forge
sdl2_ttf-2.0.15 | h4636d2b_0 26 KB conda-forge
smpeg2-2.0.0 | h6538335_1 131 KB conda-forge
tk-8.6.10 | he774522_1 3.2 MB conda-forge
xz-5.2.5 | h62dcd97_1 211 KB conda-forge
zstd-1.4.5 | h1f3a1b7_2 887 KB conda-forge
------------------------------------------------------------
Total: 41.8 MB
The following NEW packages will be INSTALLED:
docutils conda-forge/win-64::docutils-0.16-py38h9bdc248_2
freetype conda-forge/win-64::freetype-2.10.4-h546665d_0
glew conda-forge/win-64::glew-2.1.0-he025d50_0
jpeg conda-forge/win-64::jpeg-9d-h8ffe710_0
kivy conda-forge/win-64::kivy-2.0.0rc4-py38h7600b87_2
libpng conda-forge/win-64::libpng-1.6.37-h1d00b33_2
libtiff conda-forge/win-64::libtiff-4.1.0-hc10be44_6
libwebp conda-forge/win-64::libwebp-1.0.2-hfa6e2cd_5
lz4-c conda-forge/win-64::lz4-c-1.9.2-h62dcd97_2
olefile conda-forge/noarch::olefile-0.46-pyh9f0ad1d_1
pillow conda-forge/win-64::pillow-8.0.1-py38hd8d9125_0
pygments conda-forge/noarch::pygments-2.7.2-py_0
python_abi conda-forge/win-64::python_abi-3.8-1_cp38
sdl2 conda-forge/win-64::sdl2-2.0.12-h0e60522_1
sdl2_image conda-forge/win-64::sdl2_image-2.0.5-hb9708c9_2
sdl2_mixer conda-forge/win-64::sdl2_mixer-2.0.4-h6538335_0
sdl2_ttf conda-forge/win-64::sdl2_ttf-2.0.15-h4636d2b_0
smpeg2 conda-forge/win-64::smpeg2-2.0.0-h6538335_1
tk conda-forge/win-64::tk-8.6.10-he774522_1
xz conda-forge/win-64::xz-5.2.5-h62dcd97_1
zstd conda-forge/win-64::zstd-1.4.5-h1f3a1b7_2
The following packages will be UPDATED:
ca-certificates pkgs/main::ca-certificates-2020.1.1-0 --> conda-forge::ca-certificates-2020.11.8-h5b45459_0
certifi pkgs/main::certifi-2020.4.5.1-py38_0 --> conda-forge::certifi-2020.11.8-py38haa244fe_0
conda pkgs/main::conda-4.8.3-py38_0 --> conda-forge::conda-4.9.2-py38haa244fe_0
openssl pkgs/main::openssl-1.1.1g-he774522_0 --> conda-forge::openssl-1.1.1h-he774522_0
Proceed ([y]/n)?
Downloading and Extracting Packages
zstd-1.4.5 | 887 KB | ############################################################################ | 100%
sdl2_mixer-2.0.4 | 83 KB | ############################################################################ | 100%
pygments-2.7.2 | 707 KB | ############################################################################ | 100%
certifi-2020.11.8 | 150 KB | ############################################################################ | 100%
glew-2.1.0 | 824 KB | ############################################################################ | 100%
docutils-0.16 | 745 KB | ############################################################################ | 100%
sdl2_ttf-2.0.15 | 26 KB | ############################################################################ | 100%
xz-5.2.5 | 211 KB | ############################################################################ | 100%
sdl2_image-2.0.5 | 213 KB | ############################################################################ | 100%
freetype-2.10.4 | 493 KB | ############################################################################ | 100%
sdl2-2.0.12 | 1.8 MB | ############################################################################ | 100%
libwebp-1.0.2 | 356 KB | ############################################################################ | 100%
lz4-c-1.9.2 | 279 KB | ############################################################################ | 100%
olefile-0.46 | 32 KB | ############################################################################ | 100%
jpeg-9d | 366 KB | ############################################################################ | 100%
libtiff-4.1.0 | 1.1 MB | ############################################################################ | 100%
pillow-8.0.1 | 754 KB | ############################################################################ | 100%
kivy-2.0.0rc4 | 19.9 MB | ############################################################################ | 100%
ca-certificates-2020 | 183 KB | ############################################################################ | 100%
tk-8.6.10 | 3.2 MB | ############################################################################ | 100%
libpng-1.6.37 | 724 KB | ############################################################################ | 100%
conda-4.9.2 | 3.1 MB | ############################################################################ | 100%
python_abi-3.8 | 4 KB | ############################################################################ | 100%
openssl-1.1.1h | 5.8 MB | ############################################################################ | 100%
smpeg2-2.0.0 | 131 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
After installation I continued with official Pong Game Tutorial, but after running this code:
from kivy.app import App from kivy.uix.widget import Widget class PongGame(Widget): pass class PongApp(App): def build(self): return PongGame() if __name__ == '__main__': PongApp().run()
I got following error:
C:UsersmikolasProjectspong>python main.py
Traceback (most recent call last):
File "C:UsersmikolasProjectspongmain.py", line 1, in <module>
from kivy.app import App
ModuleNotFoundError: No module named 'kivy'
Expected behavior
I would expect official installation process and quickstart should actually work…
Доброго времени суток! Недавно, Я решил изучить библиотеку Киви, мне пришлось даже понизить пайтон до 3.7.5 версии.
Я столкнулся с небольшой проблемой и был бы рад если вы мне поможете. Проблема заключается, в модулях библиотеки киви, которые пайтон не может обнаружить. С офф. сайта киви, я обновил и установил все нужные элементы, для использования киви. При вводе не большого кода, который должен, вывести пустое окно,
from kivy.app import App
class TutorialApp(App):
def build(self):
return
TutorialApp().run()
выдает, следующую, ошибку
Traceback (most recent call last):
File "C:PythonВсе коды Pythonkivy.py", line 1, in <module>
from kivy.app import App
File "C:PythonВсе коды Pythonkivy.py", line 1, in <module>
from kivy.app import App
ModuleNotFoundError: No module named 'kivy.app'; 'kivy' is not a package
Буду искренне благодарен, если вы поможете мне!