Ask Your Question
0

How do I get ROS to use Pillow?

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

warsh gravatar image

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

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
1

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

demmeln gravatar image

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

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

Comments

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 imageWilliam ( 2014-07-28 19:33:15 -0600 )edit

Here: https://github.com/osrf/homebrew-simulation/issues/6#issuecomment-38644605 You have to include the X11 version of freetype in the `CFLAGS`.

William gravatar imageWilliam ( 2014-07-28 19:34:34 -0600 )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 imageWilliam ( 2014-07-28 19:36:47 -0600 )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 imagedemmeln ( 2014-07-29 04:50:55 -0600 )edit

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

William gravatar imageWilliam ( 2014-07-31 12:31:02 -0600 )edit

Ah OK makes sense

demmeln gravatar imagedemmeln ( 2014-07-31 13:20:38 -0600 )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

Stats

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

Seen: 237 times

Last updated: Jul 31 '14