Missing available fonts in Tk with Anaconda

21 views
Skip to first unread message

Benjamin

unread,
Jan 27, 2015, 4:08:49 AM1/27/15
to anac...@continuum.io
Hello. everybody.

I am making a GUI with Tk on Linux (latest Mint 64bit distribution) with Python 3.4, but I have a font problem : the available fonts are very limited (and quite ugly) when I run the program with the interpreter of Anaconda's latest distribution, but it works well with Linux default interpreter (but it is more complex for normal users after release because of modules). The problem is quite similar to this one (but I don't use Pypy).

Here is a minimal working code :

import platform
import tkinter
import tkinter.font

print(platform.python_implementation())
print(tkinter.__file__)

root = tkinter.Tk()
font_families = tkinter.font.families()
print("number of font families : ", len(font_families))
print("\n".join(font_families))



On Linux default interpreter :

CPython
/usr/lib/python3.4/tkinter/__init__.py
number of font families :  123
Noto Sans Hebrew
Padauk Book
Century Schoolbook L
OpenSymbol
Khmer OS System
Noto Serif
Ubuntu
[...]



On Anaconda :

CPython
/home/benjamin/anaconda3/lib/python3.4/tkinter/__init__.py
number of font families :  21
fangsong ti
fixed
clearlyu alternate glyphs
courier 10 pitch
open look glyph
bitstream charter
song ti
open look cursor
newspaper
clearlyu ligature
mincho
clearlyu devangari extra
clearlyu pua
clearlyu
clean
nil
clearlyu arabic
clearlyu devanagari
standard symbols l
gothic
clearlyu arabic extra



I really don't know how to solve this problem (and I prefer to use all packages and modules from Anaconda's distribution because it is easier to install for normal users after release, so it would be better that a potential solution does not need complex modification). I would be glad if you could help me.

Sincerely.

b.g0...@gmail.com

unread,
Jan 28, 2015, 2:53:56 AM1/28/15
to anac...@continuum.io, b.g0...@gmail.com
Hello.

After some tests, and a try on a random Mac OS computer with Anaconda (which worked well), it seems that the access rights is the problem on my computer : if I run the commands I have written in the previous message with a sudo, I have access to all fonts ! For information, I (re)installed Anaconda without any sudo, but the problem is still here...

Does someone know the reason and how I can solve this problem ?

Sincerely.

Matthias Hüning

unread,
Sep 17, 2015, 4:49:25 AM9/17/15
to Anaconda - Public, b.g0...@gmail.com
Hi,

Did you find a solution for this problem?
I ran into the same problem: running Anaconda-Python with sudo gives Tkinter access to the system fonts; without sudo, the fonts are replaced by (very ugly) fonts available in the local Anaconda installation.

- Matthias

gurjot...@gmail.com

unread,
Aug 21, 2017, 6:02:34 AM8/21/17
to Anaconda - Public, b.g0...@gmail.com
So you got any solution to the problem??
Reply all
Reply to author
Forward
0 new messages