Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

error: Missing python module: python-gd #42

Open
khalidamiri opened this Issue · 3 comments

2 participants

khalidamiri Christopher Hall
khalidamiri

"make" gives me this error:

make[1]: Entering directory /home/saasbook/git/wikireader/samo-lib/flash'
/home/saasbook/git/wikireader/host-tools/imagetool/image2header --inverted --header-file="ok.h" --variable-name="ok_image" "ok.png"
error: Missing python module: python-gd
sudo apt-get install python-gd
make[1]: *** [ok.h] Error 1
make[1]: Leaving directory
/home/saasbook/git/wikireader/samo-lib/flash'
make: *** [flash] Error 2

I have already installed the python-gd module.

saasbook@saasbook:~/git/wikireader$ sudo apt-get install python-gd
Reading package lists... Done
Building dependency tree

Reading state information... Done
python-gd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

They python version I have installed is 2.7.4:

saasbook@saasbook:~/git/wikireader$ python --version
Python 2.7.4

Christopher Hall
Collaborator

host-tools/imagetool/image2header seems to be unable to fin the gd module.
all it is doing is import gd and an exception is occuring.

Would you try running puthon and just typing import gd at the python prompt
maybe it will display a clearer error.

Perhaps the gd module is not getting put into the python library path,
(I am using Ubuntu 12.04.3 LTS to compile this) Which distribution are you using?
If an Ubuntu can you run lsb_release -a to get the version.

khalidamiri

Thanks a lot @hxw . I put the python-gd directory in pythonpath and it got fixed.
However there is another issue I need help with. The image2header script does not execute. I get the following error when I run "make":

make[1]: Entering directory /home/saasbook/git/wikireader/samo-lib/flash'
/home/saasbook/git/wikireader/host-tools/imagetool/image2header --inverted --header-file="fail.h" --variable-name="fail_image" "fail.png"
error: unsupported file type (only .gif|.png|.jpeg|.jpg|.gd|.gd2|.xbm|.xpm accepted)
usage: image2header <options> image
--help This message
--verbose Enable verbose output
--header-file=file Output header file
--type-name=name Name of type [LCD_ImageType]
--variable-name=name Name of the variable [image]
--inverted Black=1 White=0 pixels [White=1 Black=0]
--extra-fields Enable BytesPerRow field
make[1]: *** [fail.h] Error 1
make[1]: Leaving directory
/home/saasbook/git/wikireader/samo-lib/flash'
make: *** [flash] Error 2

It seems like the error actually originates from the getopt python module, but I don't see why would it give this error. Because I can't find any problem in the args given to it.
I tried a lot but couldn't find any solution. I am using ubuntu 11.10.

saasbook@saasbook:~/git/wikireader$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.10
Release: 11.10
Codename: oneiric

I would really appreciate some help.

Christopher Hall
Collaborator

I seem to remember seeing this error before:
unsupported file type (only .gif|.png|.jpeg|.jpg|.gd|.gd2|.xbm|.xpm accepted)

I was a long time ago,but I think the error string is hard coded, and does not indicate the true problem;
i.e. which image library is actually missing.
My guess is that the python-gd is not finding the png library; please use dpkq-query to see if
a png library is installed: on 12.04 I get:

% dpkg-query -l |grep png
ii  libpng12-0                       1.2.46-3ubuntu4              PNG library - runtime

You may have a different revision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.