Ask Your Question

How do I get ROS to use Pillow?

asked 2014-07-28 18:00:45 -0500

warsh gravatar image

updated 2014-07-28 18:53:22 -0500

demmeln gravatar image

I'm using Homebrew to install ROS - Hydro on my 10.9 Mac. While using ROS' wiki for installing hydro, 2.1.2 causes an error specifically pertaining to installing PIL. I know such has been replaced with Pillow, and have already used such before. My question is, how do I get ROS to just use Pillow instead of PIL

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-28 18:56:13 -0500

demmeln gravatar image

updated 2014-07-31 10:12:54 -0500

I have no clue how interchangeable PIL and Pillow are, so no idea how easy it would be to make the code depending on PIL use Pillow. I think your easier bet is just installing PIL.

I assume you are getting a freetype related compilation error? This has been discussed before, you will likely be successful with the following sequence of commands:

ln -s /usr/local/include/freetype2 /usr/local/include/freetype
pip install -U PIL --allow-external PIL --allow-unverified PIL
rm /usr/local/include/freetype

Update: According to William in the comments below this is a better way to work around the freetype issue:

CFLAGS="-I/usr/local/include/freetype2" pip install -U PIL --allow-external PIL --allow-unverified PIL

EDIT: you might need sudo pip instead of pip

edit flag offensive delete link more


We ran into issues where ogre would not compile with that symbolic link, it somehow created a circular or incorrect include problem with freetype. I had previously done something like `CFLAGS="-I/usr/local/include/freetype2" pip install ...` and that allowed pip to build `PIL`, without permanently changing the system. I'm not sure that is right, but I'll just look around on the internet for that.

William gravatar image William  ( 2014-07-28 19:33:15 -0500 )edit

Here: You have to include the X11 version of freetype in the `CFLAGS`.

William gravatar image William  ( 2014-07-28 19:34:34 -0500 )edit

Another option is to just do `cd /tmp && ln -s . /usr/local/include/freetype2/freetype` and then invoking pip, again this prevent permanent modification of the system.

William gravatar image William  ( 2014-07-28 19:36:47 -0500 )edit

Is there any advantage of `CFLAGS= ... pip install` vs my suggestion to create and remove the link? rosdep should maybe be capable of customizing the pip command. Something like `prepend_install: 'CFLAGS="-I/usr/local/include/freetype2"'` or `install_env: {CFLAGS:"-I/usr/local/include/freetype2}`

demmeln gravatar image demmeln  ( 2014-07-29 04:50:55 -0500 )edit

@demmeln no probably not, I didn't see that you were removing it afterwards.

William gravatar image William  ( 2014-07-31 12:31:02 -0500 )edit

Ah OK makes sense

demmeln gravatar image demmeln  ( 2014-07-31 13:20:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-07-28 18:00:45 -0500

Seen: 313 times

Last updated: Jul 31 '14