keenerd / rtl-sdr-misc

A bucket of various work-in-progress rtl-sdr ideas.
208 stars 171 forks source link

Vera.ttf claimed not to be found... #3

Closed jeromeavot closed 9 years ago

jeromeavot commented 9 years ago

Hello,

Just making my first step in the SDR world with my RPI 2 and I was trying to use heat map combined with rtl_power.

I'm facing the following issue:

pi@raspberrypi ~/rtl-sdr-misc/heatmap $ ./heatmap.py ../../test/airband.csv output Please download the Vera.ttf font and place it in the current directory.

Even if the file is actually in the folder (and is download if I delete it :-)

_pi@raspberrypi ~/rtl-sdr-misc/heatmap $ ls -alsh total 104K 4.0K drwxr-xr-x 2 pi pi 4.0K Mar 10 23:22 . 4.0K drwxr-xr-x 6 pi pi 4.0K Mar 10 23:09 .. 4.0K -rwxr-xr-x 1 pi pi 995 Mar 10 23:09 flatten.py 20K -rwxr-xr-x 1 pi pi 18K Mar 10 23:09 heatmap.py 4.0K -rw-r--r-- 1 pi pi 2.9K Mar 10 23:09 rawiq.py 68K -rw-r--r-- 1 root root 65K Mar 10 23:22 Vera.ttf

Any idea where this might come from ?

Thanks. P.S: I'm using: Python 2.7.3 (default, Mar 18 2014, 05:13:23) [GCC 4.6.3] on linux2

keenerd commented 9 years ago

Are you running a really old version of Python Image Library? If you are, try replacing it with the python-pillow library.

keenerd commented 9 years ago

Scratch that, let's fix this for real. In heatmap.py on the blank line 63 add the following:

font = ImageFont.truetype(vera_path, 10)

This will crash. However it will also produce a useful error message. Could you then paste the error message here?

jeromeavot commented 9 years ago

Thanks ! I should have thought about it, here is the output:

Traceback (most recent call last):

File "./heatmap.py", line 64, in

font = ImageFont.truetype(vera_path, 10)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 218, in truetype

return FreeTypeFont(filename, size, index, encoding)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 134, in init

self.font = core.getfont(file, size, index, encoding)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 34, in getattr

raise ImportError("The _imagingft C module is not installed")

ImportError: The _imagingft C module is not installed

On Wed, Mar 11, 2015 at 2:53 AM, Kyle Keen notifications@github.com wrote:

Scratch that, let's fix this for real. In heatmap.py on the blank line 63 add the following:

font = ImageFont.truetype(vera_path, 10)

This will crash. However it will also produce a useful error message. Could you then paste the error message here?

— Reply to this email directly or view it on GitHub https://github.com/keenerd/rtl-sdr-misc/issues/3#issuecomment-78186104.

jeromeavot commented 9 years ago

Ok indeed I try to uninstall and reinstall PIL with pip and I get the following output:

--------------------------------------------------------------------

PIL 1.1.7 SETUP SUMMARY

--------------------------------------------------------------------

version       1.1.7

platform      linux2 2.7.3 (default, Mar 18 2014, 05:13:23)

              [GCC 4.6.3]

--------------------------------------------------------------------

*** TKINTER support not available (Tcl/Tk 8.5 libraries needed)

*** JPEG support not available

*** ZLIB (PNG/ZIP) support not available

*** FREETYPE2 support not available

*** LITTLECMS support not available

Quite clear for freetype 2 :-)

I did a reinstall through apt-get:

sudo apt-get install python-imaging

And now it works like a charm !

Thanks a lot for your help.

Jérôme.

On Wed, Mar 11, 2015 at 8:00 AM, Jerome A. jerome.avot@gmail.com wrote:

Thanks ! I should have thought about it, here is the output:

Traceback (most recent call last):

File "./heatmap.py", line 64, in

font = ImageFont.truetype(vera_path, 10)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 218, in truetype

return FreeTypeFont(filename, size, index, encoding)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 134, in init

self.font = core.getfont(file, size, index, encoding)

File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 34, in getattr

raise ImportError("The _imagingft C module is not installed")

ImportError: The _imagingft C module is not installed

On Wed, Mar 11, 2015 at 2:53 AM, Kyle Keen notifications@github.com wrote:

Scratch that, let's fix this for real. In heatmap.py on the blank line 63 add the following:

font = ImageFont.truetype(vera_path, 10)

This will crash. However it will also produce a useful error message. Could you then paste the error message here?

— Reply to this email directly or view it on GitHub https://github.com/keenerd/rtl-sdr-misc/issues/3#issuecomment-78186104.

AKAMEDIASYSTEM commented 9 years ago

I have this issue as well; uninstalling and reinstalling python-imaging did not work for me.

I get the same error message when I add the statement in line 64:

  File "/usr/local/lib/python2.7/dist-packages/PIL/ImageFont.py", line 44, in __getattr__
    raise ImportError("The _imagingft C module is not installed")
ImportError: The _imagingft C module is not installed

...any idea how to proceed? I'm on a Beaglebone Black with BeagleBoard.org Debian Image 2014-12-19

Thanks!

greenestmike commented 9 years ago

For the records, same problem here while running Pything2.7 under Windows, PIL 1.1.7 :( Tried to move under root folder (never know whether " " spaces might burden the code) with no luck. Got stuck at the moment... any hint?

Thanks!

Michele

greenestmike commented 9 years ago

Update: as suggested, I tried Pillow 2.0.0 for Py 2.7 with no success...

AKAMEDIASYSTEM commented 9 years ago

I was eventually able to resolve this error yesterday - my apologies for not sharing my solution.

It turned out in my case, the version of pip I had (a version specific to Debian Wheezy) turned out to have a bug wherein it would not properly uninstall packages. I discovered this by running "pip freeze" before and after uninstall operations. I used the solution given in the highest-rated answer here to remove the packages, install the needed modules, and then reinstall Pillow Hope this helps, AKA

greenestmike commented 9 years ago

I solved too under some Debian flavors of Linux, fully updated ("Elementary" distro, if I'm not mistaking). For some uninvestigated reason it seems not to be functional using Windows.

ghost commented 9 years ago

I am having the same issue as the OP. I am running Windows 8.1 and Python2.7.1.

Thanks.

Kent