Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams
$ pip install pycairo
Downloading/unpacking pycairo
  You are installing a potentially insecure and unverifiable file. Future versions of pip will default to disallowing insecure files.
  Downloading pycairo-1.10.0.tar.bz2 (246kB): 246kB downloaded
  Running setup.py egg_info for package pycairo
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
    FileNotFoundError: [Errno 2] No such file or directory: '/home/naught101/.virtualenvs/virtualenv-3/build/pycairo/setup.py'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
  File "<string>", line 16, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/home/naught101/.virtualenvs/virtualenv-3/build/pycairo/setup.py'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/naught101/.virtualenvs/virtualenv-3/build/pycairo
Storing complete log in /home/naught101/.pip/pip.log

This is happening for pycairo, sip.

$ pip --version
pip 1.4.1 from /home/naught101/.virtualenvs/virtualenv-3/lib/python3.3/site-packages (python 3.3)

pycairo is not built by setuptools, and therefore can't be installed by pip.

As the INSTALL documentation says:

Install Procedure
-----------------
$ ./waf --help     # shows available waf options
$ ./waf configure  # use --prefix and --libdir if necessary
                   # --prefix=/usr --libdir=/usr/lib64  for Fedora 64-bit
$ ./waf build
$ ./waf install
$ python3 ./waf ...
if you have python2 and python3 installed, and the default is python 2.

You can still use pip to fetch it:

$ pip install --download=. pycairo
Downloading/unpacking pycairo
  Downloading pycairo-1.10.0.tar.bz2 (246kB): 246kB downloaded
$ tar xf pycairo-1.10.0.tar.bz2
$ cd pycairo-1.10.0
$ python ./waf etc.

Just make sure you use the Python from your virtualenv, and pass the right options to the configure command (--prefix=$VIRTUAL_ENV should be sufficient, but don't quote me on that; you might also have to set the PYTHON environment variable to the path to your virtualenv Python, or other things).

Another option is to use an alternate set of Cairo bindings, like cairocffi. But that's obviously a big change, which may not be appropriate.

I actually tried that, but I get File "/tmp/pycairo-1.10.0/.waf3-1.6.4-e3c1e08604b18a10567cfcd2d02eb6e6/waflib/Tools/python.py", line 131, in check_python_headers if dct[x]: KeyError: 'MACOSX_DEPLOYMENT_TARGET', and waf configuration fails. I'm on kubuntu. – naught101 Oct 2, 2013 at 0:17 You're going to have to post the output and the config.log somewhere (a new question, pastebin.com, whatever you find appropriate) if you want anyone to debug it for you (along with any arguments you passed to the configure line), because it's impossible to guess what might have gone wrong just from that last line (except that for some reason waf incorrectly deduced that you're on a Mac, of course). – abarnert Oct 2, 2013 at 0:45

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.