Note: I upgraded to 8.04 because my attempts to get this working on
7.10 had messed that install up so badly I decided to abandon it.
Install 8.04, and then, before you do anything else much:
- install (using synaptic) Tk8.5 and its dev package
- download Python 2.5.2 tar ball configure it like this:
./configure --prefix=/usr --enable-unicode=ucs4
make
make install
The ucs4 bit is, I think, the magic bullet. By default the tar ball
uses ucs2, but ubuntu uses ucs4, so all ubuntu's packages break, at
least those with compile C code (.so) components. ucs2/ucs4 are
pythons approach to utf8/utf16 encodings.
- cd /usr/bin; rm python; ln -s python2.5 python
The tar ball install hardlinks these two files, and the ubuntu system
checks to make sure that /usr/bin/python is a *symbolic* link to
python2.5
Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk, tkcvs
etc., you will need to build from source, but others should work ok.
Or just wait for python 2.6/3.0 :-)
Cheers -Terry
I don't advise anyone to try and get anti-aliased fonts working in
Linux (Ubuntu) by compiling python against Tk8.5, there's too much risk of messing things up. But I think I have it working now, so if you really want to...
Or just wait for python 2.6/3.0 :-)
> I don't advise anyone to try and get anti-aliased fonts working in
> Linux (Ubuntu) by compiling python against Tk8.5, there's too much risk
> of messing things up. But I think I have it working now, so if you
> really want to...
>
> Note: I upgraded to 8.04 because my attempts to get this working on
> 7.10 had messed that install up so badly I decided to abandon it.
>
> Install 8.04, and then, before you do anything else much:
>
> - install (using synaptic) Tk8.5 and its dev package
>
> - download Python 2.5.2 tar ball configure it like this:
>
> ./configure --prefix=/usr --enable-unicode=ucs4
> make
> make install
>
> The ucs4 bit is, I think, the magic bullet. By default the tar ball
> uses ucs2, but ubuntu uses ucs4, so all ubuntu's packages break, at
> least those with compile C code (.so) components. ucs2/ucs4 are
> pythons approach to utf8/utf16 encodings.
>
>
> Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk, tkcvs
> etc., you will need to build from source, but others should work ok.
>
> Or just wait for python 2.6/3.0 :-)
>
> Cheers -Terry
Just a data point - I did this on Ubuntu 8.04, python 2.6a3, and trunk
leo, and leo works & has antialiased fonts (albeit with too large size
by default). It's probably safer to build python 2.6 than 2.5, which
may have a slight chance of messing with system python 2.5. Obviously,
you should delete the link from python -> python2.6, and invoke leo
manually with python 2.6 for extra safety.
And, you should probably install it under normal /usr/local prefix
rathen than /usr.
I.e. don't do this:
> - cd /usr/bin; rm python; ln -s python2.5 python
>
> The tar ball install hardlinks these two files, and the ubuntu system
> checks to make sure that /usr/bin/python is a *symbolic* link to
> python2.5
--
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
On Fri, Apr 4, 2008 at 6:29 PM, Terry Brown <terry_...@yahoo.com> wrote:
> I don't advise anyone to try and get anti-aliased fonts working in
> Linux (Ubuntu) by compiling python against Tk8.5, there's too much risk
> of messing things up. But I think I have it working now, so if you
> really want to...
The gtk interface will fix all this... :-)
Cheers -Terry
> Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk, tkcvs
> etc., you will need to build from source, but others should work ok.
> This is a nightmare. Googling download ImageTk brings me to
> http://packages.ubuntu.com/hardy/python/python-imaging-tk
>
> If you can understand this gobbledygook you understand far more than I do.
You don't need to build separate imageTk, it seems to come with PIL
source package. I put
> Hmm. I just had a thought. Could I (and all of Leo's users) bypass these
> problems by using ipython?
No, that won't help. The best bet is still to:
- Install tk 8.5
- build python 2.6
- Install PIL source package to python 2.6 (python2.6 setup.py
install); the only change to setup.py needed is:
TCL_ROOT = "/usr/include/tcl8.5"
> Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk, tkcvs
> etc., you will need to build from source, but others should work ok.
This is a nightmare. Googling download ImageTk brings me to
http://packages.ubuntu.com/hardy/python/python-imaging-tk
If you can understand this gobbledygook you understand far more than I do.
> - I have no idea where the links files are. But since Python works it
> should allow Ubuntu to restart even if ubuntu starts using the
> newly-installed python. And indeed, restarting Ubuntu went well.
I'm still a bit concerned about this approach, since it messes with
the "system" python. What will happen when security fixes for python
come up? What about the python packages you install with apt-get later
on, will they be available normally?
Of course all this "may work", but caution should be advised.
> > > Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk,
> > > tkcvs etc., you will need to build from source, but others should
> > > work ok.
> >
> This is a nightmare. Googling download ImageTk brings me to
> http://packages.ubuntu.com/hardy/python/python-imaging-tk
I guess I don't really see the problem. If you're not aiming for
anti-aliased fonts, you should be able to get all the required imports
by:
sudo apt-get install python-imaging-tk python-imaging tk8.4 python-tk
If leo was a .deb package you'd just install that and it would tell you
about the dependencies and ask for permission to install them.
It feels to me like it's time to suddenly veer completely off topic.
I recently started playing with Virtual Box from Sun, and have
installed and run Ubuntu 8.04 under Windows XP, and Windows XP under
Ubuntu 8.04. A virtual Ubuntu 8.04 (under Ubuntu 8.04 would be fine)
would be a good way of maintaining a virgin Ubuntu install to test Leo
installation - Virtual Box has a snapshot feature so you only need to
do the initial install of Ubuntu once, and thereafter you can return to
a clean state.
There are other virtualization solutions, but Virtual Box is very easy
to use, which I think recommends it for this type of virtualization
application.
Cheers -Terry
> > - I have no idea where the links files are. But since Python works
> > it should allow Ubuntu to restart even if ubuntu starts using the
> > newly-installed python. And indeed, restarting Ubuntu went well.
>
> I'm still a bit concerned about this approach, since it messes with
> the "system" python. What will happen when security fixes for python
> come up? What about the python packages you install with apt-get later
> on, will they be available normally?
>
> Of course all this "may work", but caution should be advised.
You have a point. So far I've found that all other python packages
work, the key to getting that to happen was compiling python from
source with the --enable-unicode=ucs4 flag as the default is ucs2 but
ubuntu uses ucs4. Packages linked against Tk8.4 have to be compiled
from source.
You're right about security fixes for python - you'd have to make a
point of recompiling from the latest source to get those I guess.
Here's my original how to for anti-aliased fonts
with Ubuntu 8.04,
http://www.mail-archive.com/leo-e...@googlegroups.com/msg00320.html
with the addendum that when I moved to a new machine just a few days
ago I found I couldn't get PIL to compile from source without changing
to occurrences of '#import "tk.h"' to '#import "tcl8.5/tk.h"'.
I think the real solution is for leo and python to move to gtk - I
understand how the relationship between python and tk evolved, but I
can't see how tk can sensibly evolve to be a "modern" gui toolkit
without basically duplicating gtk at that point.
gtk support is good for linux / windows / mac os X, but probably weaker
for some of the other unixen out there on which tk works well - so
that's a problem. On the other hand tk doesn't have to go away, and
hopefully python 2.6 / 3.0 will be linked against tk 8.5 in future
distros anyway, so we're really just experiencing growing pains.
At least open source gives us the tools to fix things.
Cheers -Terry
I guess I don't really see the problem. If you're not aiming for
On Wed, 21 May 2008 08:10:56 -0500
"Edward K. Ream" <edre...@gmail.com> wrote:
> > > Packages which ubuntu thinks depend on tk8.4, like PIL, ImageTk,
> > > tkcvs etc., you will need to build from source, but others should
> > > work ok.
> >
> This is a nightmare. Googling download ImageTk brings me to
> http://packages.ubuntu.com/hardy/python/python-imaging-tk
anti-aliased fonts, you should be able to get all the required imports
by:
sudo apt-get install python-imaging-tk python-imaging tk8.4 python-tk