在anaconda python发行版中添加cairo包 [英] add cairo package in the anaconda python distribution

查看:266
本文介绍了在anaconda python发行版中添加cairo包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用蟒蛇蟒蛇发行版,我是新手,但在安装cairo软件包时遇到了麻烦.请注意,我正在使用Mac OsX.

我运行了以下命令conda install --channel https://conda.binstar.org/tshead2 cairo,安装似乎正常.

但是在python命令行中,"import cairo"会抛出未发现异常的程序包.

我已经尝试对提供的此处进行故障排除,但是没有运气.

我在做什么错了?

解决方案

我刚刚使用Autotools在Anaconda下安装了py2cairo,它似乎可以正常工作.备用的"waf"安装是有问题的,因为它选择了我系统上安装的另一版本的python(而不是我的PATH中的版本),并且尽管我能够构建py2cairo,但是蟒蛇python不喜欢它. >

有关从自动工具进行构建的基本说明,请参见此处.我假设Anaconda安装在/anaconda下,并且py2cairo tarball解压缩到py2cairo-1.10.1.另外,您将需要自动工具(例如,可从Macports获得).

  1. 在/anaconda/pkgs下解压缩py2cairo tarball
  2. 在pkgs/py2cairo-1.10.0中,创建一个包含以下命令的'bootstrap'文件:

    libtoolize --force
    aclocal
    autoheader
    automake --force-missing --add-missing
    autoconf
    

(自动工具专家将能够阐明上述步骤.我遇到的问题是,开箱即用地运行配置"会导致找不到"install.sh"等错误.重新创建上面的配置脚本解决了这个问题.)

  1. 运行引导程序

    pkgs/py2cairo-1.10.1 % sudo sh bootstrap
    

或者,您可以只从命令行运行bootstrap命令.

  1. 然后运行'configure',将前缀设置为您的python安装:

    pkgs/py2cairo-1.10.1 % sudo configure --prefix=/anaconda
    

  2. 照常进行安装:

    pkgs/py2cairo-1.10.1 % sudo gmake
    pkgs/py2cairo-1.10.1 % sudo gmake install
    

  3. 使用以下命令测试安装:

    % /anaconda/bin/python -c "import cairo"
    

我不是Python导出者,因此欢迎对上述内容发表任何评论.

I am new to using the anaconda distribution for python, and I have trouble installing the cairo package. Note that I am using Mac OsX.

I ran the following command conda install --channel https://conda.binstar.org/tshead2 cairo and the installation seems to work fine.

But in a python command line the "import cairo" throws a package not found excpetion.

I already tried to troubleshooting provided here, but no luck.

What am I doing wrong ?

解决方案

I just installed py2cairo under Anaconda, using autotools, and it seems to work fine. The alternate 'waf' install was problematic, in that it picked up another version of python installed on my system (not the one in my PATH), and while I was able to build py2cairo, anaconda python didn't like it.

Basic instructions for building from autotools are here. I assume that Anaconda is installed under /anaconda, and that the py2cairo tarball untars to py2cairo-1.10.1. Also, you will need autotools (available from Macports, for example).

  1. Untar py2cairo tarball under /anaconda/pkgs
  2. In pkgs/py2cairo-1.10.0, create a 'bootstrap' file containing the following commands :

    libtoolize --force
    aclocal
    autoheader
    automake --force-missing --add-missing
    autoconf
    

(autotools experts would be able to clarify the steps above. The problem I ran into was that running "configure" out of the box led to an error about "install.sh", etc. not being found. Re-creating the configure scripts with the above fixes this problem.)

  1. Run bootstrap

    pkgs/py2cairo-1.10.1 % sudo sh bootstrap
    

Alternatively, you could just run the bootstrap commands from the command line.

  1. Then, run 'configure', setting the prefix to your python installation :

    pkgs/py2cairo-1.10.1 % sudo configure --prefix=/anaconda
    

  2. Make and install as usual :

    pkgs/py2cairo-1.10.1 % sudo gmake
    pkgs/py2cairo-1.10.1 % sudo gmake install
    

  3. Test your installation with :

    % /anaconda/bin/python -c "import cairo"
    

I am not a Python export, and so welcome any comments on the above.

这篇关于在anaconda python发行版中添加cairo包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆