graphite-web: Unable to import cairo when installed by pip

It appears that simply pre-installing libcairo2-dev (as per #555) is insufficient for getting a working pycairo when installing via pip.

I’ve been upgrading Synthesize to use Ubuntu 14.04 and to pip install dependencies for carbon and graphite-web. Although pip install -r requirements.txt doesn’t complain about installing py2cairo, import cairo fails both in graphite-web and from the Python console. According to this post, py2cairo is intended to be installed with waf as is known to not work when installed via pip.

My current workaround is to also install Ubuntu’s python-cairo in parallel. Wondering if anyone else has stumbled across this and how we should adjust our pip instructions.

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 23 (21 by maintainers)

Most upvoted comments

Getting this in 0.9.x on Ubuntu 14.04:

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 45: ordinal not in range(128)