3

I have installed dev version 1.8 for kivy. Now I am installing the kivy-designer in windows. I have done with installing filebrowser in tools.

python ../garden.py install filebrowser
[INFO              ] Kivy v1.8.0-dev

still, when I am trying to run main.py of kivy designer in windows, it gives me error :

  Traceback (most recent call last):
     File "main.py", line 2, in <module>
     from designer.app import DesignerApp
     File "D:\Kivy-1.6.0-w32\kivy\kivy\tools\kivy-designer\designer\app.py", line 17, in <module>
     from kivy.garden.filebrowser import FileBrowser
     ImportError: No module named filebrowser

how i will solve this error?

sam
  • 18,509
  • 24
  • 83
  • 116

5 Answers5

4

They say "...we provide a tool in kivy/tools/garden..." but there is no such tool. So I got a workaround by installing required package manually by following http://kivy-garden.github.io/:

  1. Create "garden"s root directory:

    mkdir ~/.kivy/garden
    
  2. Download garden.filebrowser from https://github.com/kivy-garden/garden.filebrowser into this folder:

    cd ~/.kivy/garden
    git clone https://github.com/kivy-garden/garden.filebrowser
    
  3. Optionally, you may check your installation. In Python terminal, type:

    import kivy.garden.filebrowser
    
ceremcem
  • 3,900
  • 4
  • 28
  • 66
1
pip install kivy_garden.filebrowser

then

from kivy_garden.filebrowser import FileBrowser

@SherylHohman

Thx for your comment. I wouldn't add my answer if it didn't work. I know this topic is old, but I encountered the similar problem. This fragment doesn't work anymore. from kivy.garden.filebrowser import FileBrowser

It seems that kivy-garden changed format.

Here is sample code for a filebrowser:

from kivy.app import App
from os.path import sep, expanduser, isdir, dirname
from kivy_garden.filebrowser import FileBrowser
import sys


class TestApp(App):

    def build(self):
        if sys.platform == 'win':
            user_path = dirname(expanduser('~')) + sep + 'Documents'
        else:
            user_path = expanduser('~') + sep + 'Documents'
        browser = FileBrowser(select_string='Select',
                              favorites=[(user_path, 'Documents')])
        browser.bind(
                    on_success=self._fbrowser_success,
                    on_canceled=self._fbrowser_canceled)
        return browser

    def _fbrowser_canceled(self, instance):
        print('cancelled, Close self.')

    def _fbrowser_success(self, instance):
        print(instance.selection)

TestApp().run()

Look at this image

However I prefer to use filedialog(from tkinter) with Kivy :)

Allamaris
  • 11
  • 3
  • While this code may resolve the OP's issue, it's better to include an explanation on how your code addresses the OP's issue. This way, future visitors can learn from your post, & apply it to their own code. SO is not a coding service, but a resource for knowledge. High quality, complete answers reinforce this idea, and are more likely to be upvoted. These features, plus the requirement that all posts be self-contained, are some strengths of SO as a platform that differentiates us from forums. You can edit to add additional info &/or to supplement your explanations with source documentation. – SherylHohman Jun 14 '20 at 20:29
0

After a "garden install filebrowser" on OSX mavericks - I had to copy the garden directory from ~/.kivy/garden to /Library/Python/2.7/site-packages/kivy which worked, could probably be done with a symlink.

0

Late to the party, but I just downloaded garden from pypi here and then ran python setup.py install from within the directory.

BarthesSimpson
  • 926
  • 8
  • 21
0

Download kivy garden from https://pypi.python.org/packages/a9/af/362e0fe6943c6b7ec2630b49d1886649a4708ab748ce378acf74e4104c8b/kivy-garden-0.1.1.tar.gz

create a root directory for kivy garden like this

mkdir kivy/garden

Then use robocopy to copy the downloaded kivy garden into your root directory like this

robocopy C:\downloads\garden-0.1.1 C:\kivy\garden /e

When the files have been moved successfully, restart your command. Then install FileBrowser with this command

garden install FileBrowser

That worked for me like a charm!!

bersby
  • 1
  • 1