Editing Setup Toga with Spyder

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 2: Line 2:
  
 
This is an early draft not really ready for anybody but the author.
 
This is an early draft not really ready for anybody but the author.
 
= Current Conclusion =
 
 
'''Spyder and Toga do not play well together, dropping the attempt for now.'''
 
  
 
= Goal =
 
= Goal =
Line 18: Line 14:
 
I will try to document the most important steps and results.
 
I will try to document the most important steps and results.
  
After a brief bout with windows, I decided to move to Ubuntu as a virtual machine ( Virtual Box ) under my Windows host.
+
After a brief bout with windows, I decided to move to Ubuntu as a virtual machine under my Windows host.
  
 
Installed 18.4
 
Installed 18.4
Line 29: Line 25:
  
 
= Try Again Again ( Attempt 3 ) =
 
= Try Again Again ( Attempt 3 ) =
New virtual machine ( clone under virtual box, takes 6 minutes, try to limit install to: https://toga.readthedocs.io/en/latest/how-to/contribute.html but no virtual environment, just a clean virtual machine ).
+
New virtual machine ( clone under virtual box, takes 6 minutes, try to limit install to: https://toga.readthedocs.io/en/latest/how-to/contribute.html but no virtual environment, just a clean virtual machine
 +
 
 +
 
 +
 
 +
 
 +
= Try Again ( Attempt 2 ) =
 +
 
 +
 
 +
== Set Up Git ==
 +
 
 +
New virtual machine
 +
 
 +
  git config --global user.name "russ-hensel"
 +
  git config --global user.email xxx@comcast.net
 +
 
 +
  >>> seemed to run fine
 +
 
 +
== Upgrade Pip ==
 +
 
 +
  pip3 install --upgrade pip
 +
 
 +
  >>> Successfully installed pip-18.0
 +
 
 +
== On My Git ==
 +
 
 +
Forked then git clone and in my home directory:
 +
 
 +
  git clone https://github.com/russ-hensel/toga.git
 +
 
 +
then after much messing about got the error  ModuleNotFoundError: No module named 'travertino' so ....
 +
 
 +
  git clone  https://github.com/russ-hensel/travertino.git
 +
 
 +
== Try to Get it to Run ==
 +
 
 +
Mostly messing with path ...
 +
 
 +
mess with path until get to error: for no module gbulb so
 +
 
 +
  pip install gbulb
 +
 
 +
seemed to work, but still get  no module gbulb .. add it to the path, explicitly but still no good
 +
despite the install.  Google for gbulb yeilds pretty much zip ... so will remove it
 +
 
 +
<pre>
 +
  pip uninstall gbulb
 +
 
 +
russ@ubuntu-18-base:~$  pip uninstall gbulb
 +
Uninstalling gbulb-0.5.3:
 +
  Would remove:
 +
    /home/russ/anaconda3/lib/python3.6/site-packages/gbulb-0.5.3.dist-info/*
 +
    /home/russ/anaconda3/lib/python3.6/site-packages/gbulb/*
 +
Proceed (y/n)? y
 +
  Successfully uninstalled gbulb-0.5.3
 +
russ@ubuntu-18-base:~$
 +
 
 +
</pre>
 +
 
 +
so what about installing the demo:  https://toga.readthedocs.io/en/latest/how-to/get-started.html
 +
 
 +
  pip install toga-demo
 +
 
 +
runs fine, then try demo
 +
 
 +
</pre>
 +
Installing collected packages: colosseum, toga-core, toga-gtk, toga, toga-demo
 +
Successfully installed colosseum-0.1.6 toga-0.2.15 toga-core-0.2.15 toga-demo-0.2.15 toga-gtk-0.2.15
 +
russ@ubuntu-18-base:~$ toga-demo
 +
Creating symlink (/home/russ/anaconda3/lib/python3.6/site-packages/gi & /home/russ/anaconda3/lib/python3.6/site-packages/pygtkcompat) to system GTK+ libraries...
 +
 
 +
 
 +
 
 +
</pre>
 +
 
 +
== Read the Docs ==
 +
 
 +
https://toga.readthedocs.io/en/latest/how-to/contribute.html
 +
 
 +
= Initial Attempt =
 +
 
 +
This is incomplete, then I seemed to trash spyder, even reinstall did not fix, so starting with a clean virtual machine, and will try to document more of steops.
 +
 
 +
Also ran
 +
 
 +
*pip install toga-demo
 +
 
 +
*pip install --upgrade pip    >>>> Successfully installed pip-18.0
 +
 
 +
*toga-demo    >>> demo seemed to run
 +
 
 +
*pip install --pre toga    >>> did not get errors
 +
 
 +
*from '''[https://toga.readthedocs.io/en/latest/tutorial/tutorial-0.html Your first Toga app — Toga 0.3.0.dev10 documentation ]''' Created russ@ubuntu-18-base:~/python3/projects/toga_1.py
 +
 
 +
 
 +
*python -m toga_1.py
 +
/home/russ/anaconda3/bin/python: Error while finding module specification for 'toga_1.py' (AttributeError: module 'toga_1' has no attribute '__path__')
 +
russ@ubuntu-18-base:~/python3/projects$ python  toga_1.py
 +
 
 +
*russ@ubuntu-18-base:~/python3/projects$ python -m toga_1.py  >>> does not work _>
 +
/home/russ/anaconda3/bin/python: Error while finding module specification for 'toga_1.py' (AttributeError: module 'toga_1' has no attribute '__path__')
 +
 
 +
*russ@ubuntu-18-base:~/python3/projects$ python  toga_1.py  >>> does work but button is a big as window, just a detail?
 +
 
 +
*inside of spyder toga_1.py does not work, but after much messing around I found that changing the pythonpath in spyder would let it run
 +
 
 +
<!---
 +
 
 +
 
 +
Next is an example external link
 +
[http://www.example.com link title]
 +
 
 +
This page is really just examples of my commonly used markup
 +
 
 +
== Hidden ==
 +
 
 +
tuck stuff around you do not want to see unless editing
 +
 
 +
 
 +
<!------------- what is hidden one liner -------------------
 +
Hidden
 +
 
 +
<!--------------start hidden ------------------
 +
This is hidden
 +
 
 +
<!-------------- end hidden ---------------------
 +
 
 +
== Project ==
 +
 
 +
*Name:  Arduino Laser Cannon
 +
*Status: in fairly early development, but is working.
 +
*Technology: Arduino
 +
*Author: [[russ_hensel]] ( where you can find an email address to reach me )
 +
*Summary: An Arduino controls two servo motors to aim a laser pointer. A terminal program is used to control the Arduino.
 +
*Archive for the project will be posted.  See download section below.
 +
 
 +
=== code example ===
 +
 
 +
=== Input/Code ===
 +
 
 +
<pre>
 +
import gear
 +
 
 +
print"""Set some standards
 +
"""
 +
 
 +
washer_thick  = .1
 +
gear_clear    = .5
 +
gear_thick    = 5.
 +
plate_thick    = 1.
 +
 
 +
a_stack    =  gear.PartStack( "two gears" )
 +
 
 +
 
 +
</pre>
 +
 
  
This worked, a brief summary:
+
=== mark up examples ===
  
*Git config and download  --> went well.
+
[[Image:con1.png|alt text]]
*pip install -e src/core  --> went fine.
 
*pip install -e src/dummy  --> went fine.
 
*pip install -e src/gtk --> fails
 
*despite fail above python setup.py test  --> went fine.
 
see log at [[Toga Spyder Log]]
 
*tutorial at https://toga.readthedocs.io/en/latest/tutorial/tutorial-1.html ran in spyder after bunch of modification to sys.path.
 
*tutorial at https://toga.readthedocs.io/en/latest/tutorial/tutorial-1.html ran in ipython after different modification to sys.path from above.
 
see console at [[Toga Tutorial Log]]
 
  
Next would like some guidance on errors and proper setup, planning to submit issues to Toga....
+
[[Image:con1.png|50px]]
  
= Earlier Attempts =
+
[[Image:con1.png|50px|alt text is what]]
  
Deleted, live in history if anyone cares.
+
*[[PC-Microcontroller Communications]] discusses free terminal programs, most much better than hyperterminal.
 +
*[http://as220.org/labs/pages/Arduino%20and%20Servo%20Motor%20Workshop Arduino and Servo Motor Workshop] Course link at AS220 Labs.
  
  
 +
<!-------------- end hidden --------------------->
  
  
  
 
[[category:Python]]
 
[[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)