Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
484 views
in Technique[技术] by (71.8m points)

python - Install pycairo in virtualenv

I've tried to install pycairo in a virtualenv to use in a Django project. I've ran the pip install pycairo==1.10.0 command which finds the package and downloads it unlike other commands like pip install pycairo, etc. but when starting to install the package it throws an error.

Here's the log:

Downloading/unpacking pycairo==1.10.0
  Running setup.py egg_info for package pycairo
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
    IOError: [Errno 2] No such file or directory:
'/home/radu/Desktop/djangos/workout/venv/build/pycairo/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or directory:
'/home/radu/Desktop/djangos/workout/venv/build/pycairo/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1 in 
/home/radu/Desktop/djangos/workout/venv/build/pycairo
Storing complete log in /home/radu/.pip/pip.log

Could you please give me any hints about what to do? Should I try and write a setup.py file for the package and then try to install it? (i'm not sure it's even a solution, i still am trying to figure out what I can do).

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Good news, everyone!

I just released cairocffi: http://packages.python.org/cairocffi/

It’s a replacement for pycairo that installs with pip in a virtualenv, runs on Python 2 and 3, as well as PyPy.

pip install cairocffi

In your code:

import cairocffi as cairo
# Enjoy the same API as Pycairo.

Feedback welcome. (Although the issue tracker might be a better channel than here.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...