Reputation: 2602
I was wondering if there's an easy way to install kivy-designer. I am on Mac OS X and followed all the steps to install Kivy itself but when i tried to open application, it wasn't responding. However, when i wrote "kivy" in console, it launched the Python shell and I had no errors after executing command "import kivy":
[INFO ] [Logger ] Record log in /Applications/Kivy.app/Contents/Resources/.kivy/logs/kivy_16-03-31_1.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v3.5.0 (default, Dec 12 2015, 05:50:29)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
Then i tried to install kivy-designer , using git, on the first try i got error that i needed to install cython, after i fixed it, by installing it with homebrew, new error appeared:
[CRITICAL] [Text ] Unable to find any valuable Text provider at all!
pygame - ImportError: No module named pygame
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/text/text_pygame.py", line 12, in <module>
import pygame
pil - ImportError: No module named PIL
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kivy/core/text/text_pil.py", line 8, in <module>
from PIL import Image, ImageFont, ImageDraw
[CRITICAL] [App ] Unable to get a Text provider, abort.
I tried to install pyGame using homebrew
Also tried this:
git clone http://github.com/tito/osxrelocator
and even tried to reinstall Kivy with git:
git clone http://github.com/kivy/kivy
.
But i was getting same errors, without any updates.
Update:
Now i also tried:
kivy main.py
but i got this error:
File "main.py", line 1, in <module>
from designer.app import DesignerApp
File "/Users/macbook/kivy-designer/kivy-designer/designer/app.py", line 8, in <module>
from designer.add_file import AddFileDialog
File "/Users/macbook/kivy-designer/kivy-designer/designer/add_file.py", line 5, in <module>
from kivy.garden.filebrowser import FileBrowser
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.filebrowser'
Anyways, my question is:
is there any way to install Kivy-designer app easily on Mac OS X?, or how can i fix these errors ?
Thanks.
Upvotes: 2
Views: 4561
Reputation: 21
If you use the osx .app package it's very important that you follow the explanations here https://kivy.org/docs/installation/installation-osx.html.
That means for Python modules (it this case to install the dependencies for kivy-designer):
kivy -m pip install <modulename>
In order to use binaries installed as mentioned above (like kivy-garden) you have to activate the virtual environment. In this example to install filebrowser.
source /Applications/Kivy.app/Contents/Resources/venv/bin/activate
garden install filebrowser
deactivate
Now I have observed that even by doing this last, filebrowser was being installed under homedirectory/.kivy/garden/garden.filebrowser
. This was generating the error KeyError: 'kivy.garden.filebrowser'
because it couldn't find it.
The solution here is to copy the files from garden.filebrowser into /Applications/Kivy.app/Contents/Resources/kivy/kivy/garden
With this it should be all fine to start kivy-designer:
kivy -m designer
It took me a bit of time to find this. Hope this can help :)
Upvotes: 0
Reputation: 2602
Ok i found on how to solve this error, Thanks to zeeMonkeez for helping me:
The problem is that Homebrew is installing PyGame wrongly.
If your PyGame is not getting imported.
You need to try:
pip install hg+bitbucket.org/pygame/pygame
and then upgrading pip:
pip install --upgrade pip
It should open main.py without any errors.
Upvotes: 1