pybee / toga-demo

A demonstration of the capabilities of the Toga widget toolkit.
BSD 3-Clause "New" or "Revised" License
16 stars 9 forks source link

Fedora support? #12

Closed batisteo closed 7 years ago

batisteo commented 7 years ago

I installed the following depedencies:

dnf install python3-gobject pywebkitgtk

But I can’t get the demo running:


(toga) $ toga-demo
Traceback (most recent call last):
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_gtk/app.py", line 8, in <module>
    import gi
ImportError: No module named 'gi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/envs/toga/bin/toga-demo", line 7, in <module>
    from toga_demo.__main__ import main
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_demo/__main__.py", line 6, in <module>
    from .app import TogaDemo
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_demo/app.py", line 4, in <module>
    import toga
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga/__init__.py", line 91, in <module>
    set_platform()
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga/__init__.py", line 73, in set_platform
    locals['platform'] = importlib.import_module(module_name)
  File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_gtk/__init__.py", line 2, in <module>
    from .app import *
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_gtk/app.py", line 60, in <module>
    raise RuntimeError("Unable to locate the Python GTK+ bindings. Have you run '%s'?" % installer_command)
RuntimeError: Unable to locate the Python GTK+ bindings. Have you run 'pacman -S python-gobject'?

pip install gi


(toga) toga-demo --version
Traceback (most recent call last):
  File "/opt/envs/toga/bin/toga-demo", line 7, in <module>
    from toga_demo.__main__ import main
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_demo/__main__.py", line 6, in <module>
    from .app import TogaDemo
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_demo/app.py", line 4, in <module>
    import toga
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga/__init__.py", line 91, in <module>
    set_platform()
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga/__init__.py", line 73, in set_platform
    locals['platform'] = importlib.import_module(module_name)
  File "/usr/lib64/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_gtk/__init__.py", line 2, in <module>
    from .app import *
  File "/opt/envs/toga/lib64/python3.5/site-packages/toga_gtk/app.py", line 8, in <module>
    import gi
  File "/opt/envs/toga/lib64/python3.5/site-packages/gi/__init__.py", line 39
    print url
            ^
SyntaxError: Missing parentheses in call to 'print'

(toga) $ python
Python 3.5.2 (default, Sep 14 2016, 11:28:32) 
[GCC 6.2.1 20160901 (Red Hat 6.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
batisteo commented 7 years ago

Well, I succeed.

1) Forget about https://pypi.python.org/pypi/gi/ 2) Forget about https://pypi.python.org/pypi/pgi/ 3) In a virtual environnement, toga-demo doesn't see the gobject modules 4) In a open venv (with --system-site-packages), pip or pip3 are the global/system ones, so want to install on the system with privileges.

I succeed installing without virtual environnement.