Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not import joystick #9

Open
daliel opened this issue Mar 30, 2022 · 0 comments
Open

can not import joystick #9

daliel opened this issue Mar 30, 2022 · 0 comments

Comments

@daliel
Copy link

daliel commented Mar 30, 2022

python 3.6.9
Ubuntu 18.04
kivy 2.0.0
kivy-garden 0.1.5

joystick installed by command:
garden install joystick

try import with code:
from kivy.garden.joystick import Joystick
error:

Traceback (most recent call last):
  File "joystick_.py", line 4, in <module>
    from kivy.garden.joystick import Joystick
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
  File "/usr/local/lib/python3.6/dist-packages/kivy/garden/__init__.py", line 180, in load_module
    return self._load_module(fullname, moddir)
  File "/usr/local/lib/python3.6/dist-packages/kivy/garden/__init__.py", line 184, in _load_module
    ('', '', imp.PKG_DIRECTORY))
  File "/usr/lib/python3.6/imp.py", line 245, in load_module
    return load_package(name, filename)
  File "/usr/lib/python3.6/imp.py", line 217, in load_package
    return _load(spec)
  File "/home/daliel/coding/coding/kivy/libs/garden/garden.joystick/__init__.py", line 1, in <module>
    from .joystick import Joystick
  File "/home/daliel/coding/coding/kivy/libs/garden/garden.joystick/joystick/__init__.py", line 8, in <module>
    Builder.load_file("joystick.kv")
  File "/usr/local/lib/python3.6/dist-packages/kivy/lang/builder.py", line 306, in load_file
    return self.load_string(data, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/kivy/lang/builder.py", line 373, in load_string
    parser = Parser(content=string, filename=fn)
  File "/usr/local/lib/python3.6/dist-packages/kivy/lang/parser.py", line 402, in __init__
    self.parse(content)
  File "/usr/local/lib/python3.6/dist-packages/kivy/lang/parser.py", line 508, in parse
    self.execute_directives()
  File "/usr/local/lib/python3.6/dist-packages/kivy/lang/parser.py", line 477, in execute_directives
    mod = getattr(mod, part)
AttributeError: module 'kivy.garden' has no attribute 'joystick'

try with another code:
from kivy_garden.joystick import Joystick
error:

Traceback (most recent call last):
   File "joystick_.py", line 5, in <module>
     from kivy_garden.joystick import Joystick
 ModuleNotFoundError: No module named 'kivy_garden.joystick'

But if i import graph all ok:

from kivy_garden.graph import Graph
from kivy.garden.graph import Graph

How I can import joystick

@daliel daliel changed the title can not import joystic can not import joystick Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant