我正在使用python3,我正在尝试在Ubuntu上安装" cairocffi ".为此,我已成功安装:
蟒蛇-dev的
libffi-dev的
CFFI
但是当我试图安装"cairocffi"时pip install cairocffi
,我得到了:
File "/usr/local/lib/python3.2/dist-packages/setuptools/dist.py", line 272 , in __init__ _Distribution.__init__(self,attrs) File "/usr/lib/python3.2/distutils/dist.py", line 261, in __init__ self.finalize_options() File "/usr/local/lib/python3.2/dist-packages/setuptools/dist.py", line 327 , in finalize_options ep.load()(self, ep.name, value) File "/usr/local/lib/python3.2/dist-packages/cffi/setuptools_ext.py", line 161, in cffi_modules add_cffi_module(dist, cffi_module) File "/usr/local/lib/python3.2/dist-packages/cffi/setuptools_ext.py", line 48, in add_cffi_module execfile(build_file_name, mod_vars) File "/usr/local/lib/python3.2/dist-packages/cffi/setuptools_ext.py", line 24, in execfile exec(code, glob, glob) File "cairocffi/ffi_build.py", line 30, inffi.cdef(constants._CAIRO_HEADERS) AttributeError: 'module' object has no attribute '_CAIRO_HEADERS' ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-y0b_ir/cairocffi
Sam.. 23
通过安装特定版本的cairocffi(版本= 0.6)解决了我的问题
pip install cairocffi==0.6
小智.. 17
我今天也遇到了这个问题.您是否正在使用Real Python课程?
无论如何,为了解决这个问题,我安装了python-dev的python 3版本:
sudo apt-get install python3-dev sudo apt-get install libffi-dev sudo pip3 install cffi sudo pip3 install cairocffi
希望这可以帮助!
通过安装特定版本的cairocffi(版本= 0.6)解决了我的问题
pip install cairocffi==0.6
我今天也遇到了这个问题.您是否正在使用Real Python课程?
无论如何,为了解决这个问题,我安装了python-dev的python 3版本:
sudo apt-get install python3-dev sudo apt-get install libffi-dev sudo pip3 install cffi sudo pip3 install cairocffi
希望这可以帮助!