Editing Toga Tutorial Log

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
= What =
 
= What =
  
This page is a log of running the Toga Tutorial at:  https://toga.readthedocs.io/en/latest/tutorial/tutorial-1.html  see: [[Setup Toga with Spyder]]
+
This page is a log of setting up Toga on Ubuntu for Spyder see: [[Setup Toga with Spyder]]
  
= The Console Log =
+
= The Log =
 
<pre>
 
<pre>
 
>================== run tutorial inside of spyder with adjusted sys.path =====================
 
 
running in spyter, the toga_2.py gets its own  interpreter, start fresh each time
 
 
 
added code for sys.path ( does not run without this, some may have more than absolutely necessary )
 
 
print( "--- modify sys.path if necessary add until it works ---" )
 
import sys
 
for_sys_path    = []
 
for_sys_path.append( "/home/russ/python03" )
 
for_sys_path.append( "/home/russ/toga/src" )
 
for_sys_path.append( "/home/russ/toga/src/core" )
 
for_sys_path.append( "/home/russ/toga/src/gtk" )
 
for_sys_path.append( '/home/russ/anaconda3/lib/python3.6/site-packages' )
 
test_path_add = for_sys_path  [0]
 
 
if sys.path[ 0 ] != test_path_add:
 
    print( "adding to sys.path" )
 
    sys.path  = for_sys_path + sys.path
 
    pass
 
else:
 
    print( " sys.path already modified" )
 
 
    ...... rest of file  taken from:  https://toga.readthedocs.io/en/latest/tutorial/tutorial-1.html
 
 
---------------- here is spyder ipython console output ------------------
 
 
 
runfile('/home/russ/python03/toga_proj/toga_2.py', wdir='/home/russ/python03/toga_proj')
 
--- modify sys.path if necessary add until it works ---
 
adding to sys.path
 
sys.path = ['/home/russ/python03', '/home/russ/toga/src', '/home/russ/toga/src/core', '/home/russ/toga/src/gtk', '/home/russ/anaconda3/lib/python3.6/site-packages', '', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/russ/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3/dist-packages/IPython/extensions', '/home/russ/.ipython']
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: TextInput.set_alignment()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: TextInput.set_alignment()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: TextInput.set_font()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Widget.set_hidden()
 
[GTK+] Not implemented: Button.set_background_color()
 
[GTK+] Not implemented: Widget.set_hidden()
 
 
======================= in terminal following ipython fails ===================
 
 
 
russ@ubuntu-18-base:~$ python /home/russ/python03/toga_proj/toga_2.py
 
--- modify sys.path if necessary ---
 
adding to sys.path
 
sys.path = ['/home/russ/python03', '/home/russ/toga/src', '/home/russ/toga/src/core', '/home/russ/toga/src/gtk', '/home/russ/anaconda3/lib/python3.6/site-packages', '', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/russ/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3/dist-packages/IPython/extensions', '/home/russ/.ipython']
 
Traceback (most recent call last):
 
  File "/usr/lib/python3.6/asyncio/__init__.py", line 9, in <module>
 
    from . import selectors
 
ImportError: cannot import name 'selectors'
 
 
During handling of the above exception, another exception occurred:
 
 
Traceback (most recent call last):
 
  File "/home/russ/python03/toga_proj/toga_2.py", line 43, in <module>
 
    import toga
 
  File "/home/russ/toga/src/core/toga/__init__.py", line 1, in <module>
 
    from .app import *
 
  File "/home/russ/toga/src/core/toga/app.py", line 6, in <module>
 
    from toga.command import CommandSet
 
  File "/home/russ/toga/src/core/toga/command.py", line 1, in <module>
 
    from toga.handlers import wrapped_handler
 
  File "/home/russ/toga/src/core/toga/handlers.py", line 1, in <module>
 
    import asyncio
 
  File "/usr/lib/python3.6/asyncio/__init__.py", line 11, in <module>
 
    import selectors  # Will also be exported.
 
  File "/usr/lib/python3.6/selectors.py", line 10, in <module>
 
    import math
 
ModuleNotFoundError: No module named 'math'
 
russ@ubuntu-18-base:~$
 
 
------------------------ similiar failure in straight ahead python ..... ---------------------
 
 
----- no output shown
 
 
------------------------- also works in ipython from terminal if path setting is changed to: ---------------
 
 
# brute force
 
print( " sys.path set from literal" ) 
 
sys.path = ['/home/russ/python03', '/home/russ/toga/src', '/home/russ/toga/src/core', '/home/russ/toga/src/gtk', '/home/russ/anaconda3/lib/python3.6/site-packages',
 
'', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/home/russ/.local/lib/python3.6/site-packages', '/usr/local/lib/python3.6/dist-packages',
 
'/usr/lib/python3/dist-packages', '/usr/lib/python3/dist-packages/IPython/extensions', '/home/russ/.ipython']   
 
 
-----------
 
 
rest of ouptut similar to the Spyder console above.
 
 
 
</pre>
 
</pre>
 
[[category:Python]]
 

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)