using ipython with leo and python2.6

3 views
Skip to first unread message

John Griessen

unread,
May 19, 2010, 1:04:48 PM5/19/10
to leo-e...@googlegroups.com
I've found how to test run leo with ipython OK. The leo build and
ipython are called using python2.6.

Now can I deal with python code that only works with python2.5 as
my ipython runnable script? In other words can the python called
by lines of the leo-ipython edited script be python2.5?

John

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.

tfer

unread,
May 19, 2010, 1:10:53 PM5/19/10
to leo-editor
Well, as far as I know, neither requires 2.6, you could just run them
under 2.5.

Might help to know what you are trying to do.

Tom

John Griessen

unread,
May 19, 2010, 3:02:35 PM5/19/10
to leo-e...@googlegroups.com
tfer wrote:
> Well, as far as I know, neither requires 2.6, you could just run them
> under 2.5.

the build instructions for leo from bzr said python2.6 was needed,
so I used python2.6.

Can leo built with python2.6 really be run fine with python2.5?
How about ipython 0.10-2 debian package? The package
dependencies say: python (>= 2.5) recommended, so 2.5 is OK there.
If leo can operate with 2.5 while built with 2.6, that's the thing that
will simplify my next steps.

I'm wanting to use leo-ipython to make 3D models with pythonocc,
which compiles with python2.5 and the build for that isn't ready
for 2.6. PythonOCC is a python way to call functions of OpenCascade
to build up a model of something so it makes a workable model to cut real
material with. As you build up a python script, you check your results
for code correctness by running 3D viewers and observing functions
behaving OK with no errors. When you "see" you are done via 3D view programs,
you are done scripting in python, and ready to use that model to output
CAD data in different formats
that CAM programs can run on.

John

tfer

unread,
May 19, 2010, 3:16:36 PM5/19/10
to leo-editor


On May 19, 2:02 pm, John Griessen <j...@foseda.com> wrote:
> tfer wrote:
> > Well, as far as I know, neither requires 2.6, you could just run them
> > under 2.5.
>
> the build instructions for leo from bzr said python2.6 was needed,
> so I used python2.6.
>
Well, I think the 2.6 was put in so Leo could be updated to run on 3.x
series python, you might have to grab a version of Leo before that
requirement and run it that way.

Was the IPython running okay for you?, 10-2 is a latter version then I
have used and I think that Ville mention that the 10 series had some
issues when used with Leo

Tom

Ville M. Vainio

unread,
May 19, 2010, 3:23:19 PM5/19/10
to leo-e...@googlegroups.com
On Wed, May 19, 2010 at 10:16 PM, tfer <tfeth...@aol.com> wrote:

> Was the IPython running okay for you?, 10-2 is a latter version then I
> have used and I think that Ville mention that the 10 series had some
> issues when used with Leo

Yes, ipython 0.9.x max is recommended for now.

--
Ville M. Vainio
http://tinyurl.com/vainio

Ville M. Vainio

unread,
May 19, 2010, 3:26:19 PM5/19/10
to leo-e...@googlegroups.com
On Wed, May 19, 2010 at 10:02 PM, John Griessen <jo...@foseda.com> wrote:

> I'm wanting to use leo-ipython to make 3D models with pythonocc,
> which compiles with python2.5 and the build for that isn't ready
> for 2.6.  PythonOCC is a python way to call functions of OpenCascade

It seems they are using the pythonocc package on lucid, so it should
work ok with python 2.6?

--
Ville M. Vainio
http://tinyurl.com/vainio

John Griessen

unread,
May 19, 2010, 3:59:07 PM5/19/10
to leo-e...@googlegroups.com
Ville M. Vainio wrote:
> It seems they are using the pythonocc package on lucid, so it should
> work ok with python 2.6?

It will only build with 2.5. This is all confusing me -- builds of programming language
wrappers that can run later versions of programming languages connected with earlier version
of ipython... Yi!

Ville M. Vainio wrote:

> Yes, ipython 0.9.x max is recommended for now.

Thanks for the recommendation.

John

John Griessen

unread,
May 19, 2010, 4:01:24 PM5/19/10
to leo-e...@googlegroups.com
Ville M. Vainio wrote:

> Yes, ipython 0.9.x max is recommended for now.

Debian has:


# lenny (stable) (python): enhanced interactive Python shell
0.8.4-1: all
# squeeze (testing) (python): enhanced interactive Python shell
0.10-2: all

Will 0.8.4 ipython be OK?

John

Ville M. Vainio

unread,
May 19, 2010, 4:03:18 PM5/19/10
to leo-e...@googlegroups.com
On Wed, May 19, 2010 at 11:01 PM, John Griessen <jo...@foseda.com> wrote:

>
> Will 0.8.4 ipython be OK?

At some point it was - not sure if it's anymore.

You could also try

https://launchpad.net/~villemvainio/+archive/ppa/+files/ipython09_0.9.1-2_all.deb


--
Ville M. Vainio
http://tinyurl.com/vainio

John Griessen

unread,
May 19, 2010, 4:10:55 PM5/19/10
to leo-e...@googlegroups.com

John Griessen

unread,
May 19, 2010, 5:24:24 PM5/19/10
to leo-e...@googlegroups.com

I started following an example from ILeo_doc.txt where you
start leo and ipython together,
make a node of valid python and execute that code by alt+I
and found an error about tkinter. python-tk was installed,
so I quit leo, quit ipython, read some, and wanted to try leo again
and I just got errors.

The errors the second time were unrelated to the first
and gave me few ideas... Anyone else know what to do here?

John

I have a start script leo.sh

#!/bin/bash
/usr/bin/python2.5 /opt/leo/launchLeo.py "$@"

running leo.sh
or
/usr/bin/python2.5 /opt/leo/launchLeo.py
or
/opt/leo/launchLeo.py

all give the same message right away:

john@toolbench:~/FABprojects/pythonocc-test$ leo.sh
*** isPython3: False
/opt/leo/leo/core/leoCache.py:591: Warning: 'as' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "/opt/leo/launchLeo.py", line 7, in <module>
import leo.core.runLeo
File "/opt/leo/leo/core/runLeo.py", line 50, in <module>
import leo.core.leoApp as leoApp
File "/opt/leo/leo/core/leoApp.py", line 11, in <module>
import leo.core.leoCache as leoCache
File "/opt/leo/leo/core/leoCache.py", line 591
except OSError as e:

John Griessen

unread,
May 19, 2010, 5:44:54 PM5/19/10
to leo-e...@googlegroups.com
John Griessen wrote:
> I have a start script leo.sh
>
> #!/bin/bash
> /usr/bin/python2.5 /opt/leo/launchLeo.py "$@"


I found the difference was the python version.

/usr/bin/python2.6 /opt/leo/launchLeo.py starts leo just fine.

I compiled with 2.6 and it only runs with 2.6 now.

So, again, what is an acceptable combination of things to do?

run leo --ipython from python2.6 and it will be python2.6 in ipython, right?

I think I'll need python2.5 for pythonOCC. Need to ask them.

John

John Griessen

unread,
May 19, 2010, 6:30:04 PM5/19/10
to leo-e...@googlegroups.com
I changed python-tk to the 2.6.5 version and can do a push to ipython from leo now.

Following the ILeo_doc.txt example, when I push to ipython I get good output:

<3> 3
--------------------------------> print("hello")
hello
<5> 7
<7> 'HELLO WORLD'

So it's working well enough to try some pythonOCC now.

In case that requires python2.5, (I'm going to try with the assumption
I can get by avoiding the latest python2.6 extensions I don't know about),
What leo release would I go back to for python2.5?

John Griessen

zpcspm

unread,
May 20, 2010, 5:10:10 AM5/20/10
to leo-editor
If I would see errors about caching, my first action would be to
remove the whole ~/.leo/db and restart leo again. This might help
avoiding triggering caching logic.
Reply all
Reply to author
Forward
0 new messages