Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: The _imagingft C module is not installed #2478

Closed
flaper87 opened this issue Apr 5, 2017 · 3 comments
Closed

ImportError: The _imagingft C module is not installed #2478

flaper87 opened this issue Apr 5, 2017 · 3 comments

Comments

@flaper87
Copy link

flaper87 commented Apr 5, 2017

The latest Pillow release (4.1.0) seems to have broken some of the OpenStack CI jobs. More specifically, it's failing because it can't import _imagingft. By looking into other reports, it seems that the solution has been to install freetype but given the previous version worked well, I'm doubting that's the problem.

2017-04-05 08:16:41.286413 | Traceback (most recent call last):
2017-04-05 08:16:41.286443 |   File "setup.py", line 22, in <module>
2017-04-05 08:16:41.286453 |     pbr=True)
2017-04-05 08:16:41.286471 |   File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
2017-04-05 08:16:41.286480 |     dist.run_commands()
2017-04-05 08:16:41.286499 |   File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
2017-04-05 08:16:41.286509 |     self.run_command(cmd)
2017-04-05 08:16:41.286528 |   File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
2017-04-05 08:16:41.286536 |     cmd_obj.run()
2017-04-05 08:16:41.286569 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/pbr/builddoc.py", line 200, in run
2017-04-05 08:16:41.286585 |     self._sphinx_run()
2017-04-05 08:16:41.286619 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/pbr/builddoc.py", line 155, in _sphinx_run
2017-04-05 08:16:41.286639 |     freshenv=self.fresh_env, warningiserror=self.warning_is_error)
2017-04-05 08:16:41.286673 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/sphinx/application.py", line 199, in __init__
2017-04-05 08:16:41.286686 |     self.setup_extension(extension)
2017-04-05 08:16:41.286723 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/sphinx/application.py", line 523, in setup_extension
2017-04-05 08:16:41.286735 |     ext_meta = mod.setup(self)
2017-04-05 08:16:41.286762 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/doc/source/_exts/badges.py", line 202, in setup
2017-04-05 08:16:41.286775 |     _generate_teams_badges(app)
2017-04-05 08:16:41.286805 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/doc/source/_exts/badges.py", line 173, in _generate_teams_badges
2017-04-05 08:16:41.286826 |     svg_data = _generate_badge('project', 'unofficial', colorscheme='red')
2017-04-05 08:16:41.286855 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/doc/source/_exts/badges.py", line 84, in _generate_badge
2017-04-05 08:16:41.286874 |     font = ImageFont.truetype('DejaVuSans.ttf', 11)
2017-04-05 08:16:41.286907 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/PIL/ImageFont.py", line 238, in truetype
2017-04-05 08:16:41.286922 |     return FreeTypeFont(font, size, index, encoding)
2017-04-05 08:16:41.286955 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/PIL/ImageFont.py", line 127, in __init__
2017-04-05 08:16:41.286972 |     self.font = core.getfont(font, size, index, encoding)
2017-04-05 08:16:41.287011 |   File "/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/lib/python3.5/site-packages/PIL/ImageFont.py", line 37, in __getattr__
2017-04-05 08:16:41.287030 |     raise ImportError("The _imagingft C module is not installed")
2017-04-05 08:16:41.287045 | ImportError: The _imagingft C module is not installed
2017-04-05 08:16:41.336119 | ERROR: InvocationError: '/home/jenkins/workspace/gate-governance-docs-ubuntu-xenial/.tox/venv/bin/python setup.py build_sphinx'

The code calling Pillow is this https://github.com/openstack/governance/blob/master/doc/source/_exts/badges.py#L84

font = ImageFont.truetype('DejaVuSans.ttf', 11)

(Also, credits to @ttx who found it)

@wiredfool
Copy link
Member

I'm going to guess that you're installing from source, rather than the previous manylinux wheel binaries, and don't have the dependencies for imagefont, but do for jpeg and libz.

The manylinux wheels didn't get produced yesterday due to EOL on a centos repository that they depend on. That's been fixed overnight, and I'm building the wheels now.

@wiredfool
Copy link
Member

Manylinux wheels for x64 are uploaded to pypi, try again now.

@ttx
Copy link

ttx commented Apr 5, 2017

Confirmed fixed, thanks !

openstack-gerrit pushed a commit to openstack/governance that referenced this issue Apr 5, 2017
This reverts commit 5ddcdce.

According to wiredfool on the GitHub issue[1], this was an issue
with manylinux wheels as (non-)uploaded to PyPI and should be
fixed now. Let's see.

[1] python-pillow/Pillow#2478

Change-Id: I6ca17860cd73feda5715589adc31f31c506edf31
openstack-gerrit pushed a commit to openstack/openstack that referenced this issue Apr 5, 2017
Project: openstack/governance  d6a44c31be75f4ecf4c55752d7dc8a5c17be2b21

Revert "Blacklist Pillow 4.1.0"

This reverts commit 5ddcdce53abd279fcc0ab3942248aef1018ab6e5.

According to wiredfool on the GitHub issue[1], this was an issue
with manylinux wheels as (non-)uploaded to PyPI and should be
fixed now. Let's see.

[1] python-pillow/Pillow#2478

Change-Id: I6ca17860cd73feda5715589adc31f31c506edf31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants