I have downloaded Leo onto my Mac OS 10.6 MacBook Pro. I posted this
question to the leo-editor-users list, but the response I got
suggested that this was a better forum, so I'm trying here. My
original thread at the following URL erroneously said OS 10.5; sorry
about that.
http://groups.google.com/group/leo-editor-users/browse_thread/thread/f2f5b0ea0df49ca1
I have installed SIP and PyQt4 and Leo according to its installation
instructions. But every time I run Leo I get the errors below about
an inability to find Qt. (I have had Qt4 on my system for some time,
before installing SIP or PyQt4. I assume PyQt4 wouldn't build unless
Qt were there anyway?)
qtGui.py: can not import Qt
qtGui.py: can not import Qt
qtGui.py: can not import Qt
Traceback (most recent call last):
File "launchLeo.py", line 8, in <module>
leo.core.runLeo.run()
File "/Users/nathan/Downloads/Leo-4-6-2-final/leo/core/
runLeo.py",
line 95, in run
ok = doPostPluginsInit(args,fn,relFn,script)
File "/Users/nathan/Downloads/Leo-4-6-2-final/leo/core/
runLeo.py",
line 323, in doPostPluginsInit
g.app.createQtGui(fileName='core')
File "/Users/nathan/Downloads/Leo-4-6-2-final/leo/core/
leoApp.py",
line 345, in createQtGui
import leo.plugins.qtGui
File "/Users/nathan/Downloads/Leo-4-6-2-final/leo/plugins/
qtGui.py", line 70, in <module>
class QTextBrowserSubclass (QtGui.QTextBrowser):
NameError: name 'QtGui' is not defined
I can run Leo with --gui=tk, but of course it doesn't look very good
at all, whereas I suspect a Qt gui will be much better. (I use Qt to
build cross-platform software myself, and it looks far better than the
tk results I got for Leo.)
Anyone know how I can get Leo running with the Qt gui on OS 10.6?
Thank you and happy new year!
Nathan
That will be my course of action if no one can solve my problem; I
won't bump again. But that would be disappointing, so I'm giving this
list one more try. I also suspect that I must be doing something
unusual wrong, since I'd be surprised if a product in version 4 truly
has a basic "can't launch" problem, except in rare cases (mine?).
Thank you in advance if anyone can help.
Nathan
On Dec 31 2009, 6:36 pm, Nathan Carter <nathancart...@gmail.com>
wrote:
> Dear Leo developers,
>
> I have downloaded Leo onto my Mac OS 10.6 MacBook Pro. I posted this
> question to the leo-editor-users list, but the response I got
> suggested that this was a better forum, so I'm trying here. My
> original thread at the following URL erroneously said OS 10.5; sorry
> about that.
> http://groups.google.com/group/leo-editor-users/browse_thread/thread/...
No problem.
I have not had access to a Mac until recently. I'll see what I can do.
Edward
On Dec 31 2009, 5:36 pm, Nathan Carter <nathancart...@gmail.com>
wrote:
> I have installed SIP and PyQt4 and Leo according to its installation
> instructions. But every time I run Leo I get the errors below about
> an inability to find Qt. (I have had Qt4 on my system for some time,
> before installing SIP or PyQt4. I assume PyQt4 wouldn't build unless
> Qt were there anyway?)
I spent several hours yesterday investigating this, and I was finally
able to get Leo to work on Mac OS X 10.6.1 on a big-screen Mac. I
think it's called an iMac :-)
It wasn't fun.
I have learned to take *complete* notes any time I try to install
complex software, especially on Mac OS X. Even with these notes, I
can't guarantee a clear path to success because of several false
starts. The only way to be sure that these instructions will work
would be to de-install everything, and that I don't know how to do,
and it might cause other problems.
With these caveats, here is the quick start:
1. Build sip and PyQt4 as usual:
- cd sip (or PyQt-mac-gpl-4.6.2)
- python configure.py
- sudo make clean (to undo previous makes)
- sudo make
- sudo make install
Notes:
A: If make fails, you may have to download and install the Qt sdk from
http://qt.nokia.com/downloads/sdk-mac-os-cpp
This is a big package: 602 meg.
B: Very important. Somewhere you may encounter in a readme file
instructions to use the --arch i386 or --use_arch i386 option
when running python configure.py. **Do not do this!**. The qt
binary installer (see step 2) installs the correct binaries for MacOS.
2. Install Qt using the binary package at http://qt.nokia.com/downloads/mac-os-cpp
This page was not easy for me to find. I don't know why the nokia
folk are hiding it.
I believe this step is essential. Probably because it installs Qt
with the proper architecture.
3. Test the install by invoking Python and then doing the following:
import PyQt4
import PyQt4.QtCore
If either import fails because PyQt4 can't be found, you may have to
add PyQt4 to your python path. Here is my sitecustomize.py file in
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
import sys
print ('ekr: /usr/lib/sitecustomize.py')
#for z in sys.path:
# print(z)
sys.path.append('/Library/Python/2.6/site-packages/PyQt4')
You have a bigger problem if the second import fails. Iirc (alas, I
didn't keep notes), at first I got a message from Python about
QtCore.so being found, but it's architecture did not match Python's.
That is when I knew I had to use a binary installer :-)
4. Use bzr to pull down the leo-editor branch. This is highly
recommended because Leo 4.7 b1 is about 6 months old. As usual, the
initial install of bzr is a bit of a pain: you may have to create rsa
public/private keys and tell launchpad about them. The essential
command is:
ssh-keygen -t rsa
Do *not* create a pgp key: bzr requires an rsa key. There are
excellent instructions at https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
You can follow, as I did, the instructions for ubuntu.
Whew! I *was* able to get Qt working on the Mac. Having said that,
there are several reservations:
1. It's clear that forcing people to install bzr is a big barrier. I
get annoyed every time I have to generate an ssh key. It's getting
easier, but it is never fun. The reinforces the need for a b2 release
asap.
2. Mac key bindings are not the same as ubuntu or Windows. It's not
clear to me whether this is a major problem, but you will want to do
some playing with the key bindings.
HTH and good luck. If you are able to get Qt installed, please let me
know how it went. Thanks.
Edward
I think this is not mandatory if one just want to pull some code from
launchpad. Retrieving a versioned source code tree is similar to
downloading a source code tarball. It's a read-only operation. You
don't have to be logged into launchpad in order to do that.
Authentication via ssh keys is required only for write operations
(push).
However, the requirement about having bzr installed still applies.
Some people might install bzr for the first time just for retrieving
the source code of leo. I was one of those guys myself :) Frankly, I
strongly disagree that installing bzr is a barrier. It was the first
distributed version control system that I've touched. Nowadays I store
a lot of personal data, including source code and leo outlines in bzr.
Learning the basics of it pays off greatly. And it takes about one
hour.
>> 1. It's clear that forcing people to install bzr is a big barrier. I
>> get annoyed every time I have to generate an ssh key. It's getting
>> easier, but it is never fun. The reinforces the need for a b2 release
>> asap.
>>
>
> I think this is not mandatory if one just want to pull some code from
> launchpad.
Yes. I thought so too, but somehow yesterday I was having trouble.
No big deal.
Edward
Thank you for taking all the time to do that! I'm traveling right now
but hope some time this week to tinker around with these things. I
already do Qt software development, and so already have Qt installed.
I'll let you know how it goes.
Nathan
> A: If make fails, you may have to download and install the Qt sdk fromhttp://qt.nokia.com/downloads/sdk-mac-os-cpp
> This is a big package: 602 meg.
>
> B: Very important. Somewhere you may encounter in a readme file
> instructions to use the --arch i386 or --use_arch i386 option
> when running python configure.py. **Do not do this!**. The qt
> binary installer (see step 2) installs the correct binaries for MacOS.
>
> 2. Install Qt using the binary package athttp://qt.nokia.com/downloads/mac-os-cpp
> excellent instructions athttps://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
I have already installed SIP and PyQt as per their installation
instructions, and already have Qt installed from my own development
work, so I did not do steps 1 and 2 of your detailed instructions.
HOWEVER, I note that I did follow the SIP/PyQt installation
instructions exactly, including the --arch command. So then I move to
your step 3, testing my PyQt installation.
Invoking "import PyQt4" inside Python works fine. But invoking
"import PyQt4.QtCore" gives the following error.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtCore.so,
2): no suitable image found. Did find:
/Library/Python/2.6/site-packages/PyQt4/QtCore.so: mach-o, but wrong
architecture
Your email seems to suggest that this will be fixed by using the
binary installer to which you link. Will that harm my current Qt
installation in any way? I just want to be sure I understand the
steps I'm taking before I do something bad.
Thank you again for your help!
Nathan
You're asking questions that I am not really qualified to answer. My
guess is that installing the binary installer will work, but I don't
really know about earlier installs. Any *nix gurus out there with a
better answer?
BTW, the message you cite above is similar to the one I got, but iirc
the message I got involved some other library.
Edward
On Jan 18, 2:47 pm, "Edward K. Ream" <edream...@gmail.com> wrote:
> You're asking questions that I am not really qualified to answer. My
> guess is that installing the binary installer will work, but I don't
> really know about earlier installs. Any *nix gurus out there with a
> better answer?
You may be interested in this thread on PyQt:
http://www.riverbankcomputing.com/pipermail/pyqt/2010-January/025647.html
part of the PyQt archives:
http://www.riverbankcomputing.com/pipermail/pyqt/
Edward
qtGui.py: can not import Qt
Traceback (most recent call last):
File "launchLeo.py", line 8, in <module>
leo.core.runLeo.run()
File "/Applications/Leo/leo/core/runLeo.py", line 88, in run
fn,relFn,script = doPrePluginsInit(fileName,pymacs)
File "/Applications/Leo/leo/core/runLeo.py", line 119, in
doPrePluginsInit
createSpecialGui(gui,pymacs,script,windowFlag)
File "/Applications/Leo/leo/core/runLeo.py", line 141, in
createSpecialGui
elif gui == 'qt': g.app.createQtGui(tag)
File "/Applications/Leo/leo/core/leoApp.py", line 346, in
createQtGui
import leo.plugins.qtGui
File "/Applications/Leo/leo/plugins/qtGui.py", line 70, in <module>
class QTextBrowserSubclass (QtGui.QTextBrowser):
NameError: name 'QtGui' is not defined
On Jan 19, 7:04 pm, "Edward K. Ream" <edream...@gmail.com> wrote:
> On Jan 18, 2:47 pm, "Edward K. Ream" <edream...@gmail.com> wrote:
>
> > You're asking questions that I am not really qualified to answer. My
> > guess is that installing the binary installer will work, but I don't
> > really know about earlier installs. Any *nix gurus out there with a
> > better answer?
>
> You may be interested in this thread on PyQt:
>
> http://www.riverbankcomputing.com/pipermail/pyqt/2010-January/025647....