[MacPorts] #50785: py27-cairosvg: AttributeError: 'module' object has no attribute 'ANTIALIAS_FAST' (was: Can't import py27-cairosvg)

MacPorts noreply at macports.org
Thu Mar 3 04:43:18 PST 2016


#50785: py27-cairosvg: AttributeError: 'module' object has no attribute
'ANTIALIAS_FAST'
----------------------------+--------------------
  Reporter:  darius@…       |      Owner:  sean@…
      Type:  defect         |     Status:  new
  Priority:  Normal         |  Milestone:
 Component:  ports          |    Version:  2.3.4
Resolution:                 |   Keywords:
      Port:  py27-cairosvg  |
----------------------------+--------------------
Changes (by ryandesign@…):

 * owner:  macports-tickets@… => sean@…


Old description:

> {{{
> In [20]: import cairosvg
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
> <ipython-input-20-8605454d1a82> in <module>()
> ----> 1 import cairosvg
>
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /site-packages/cairosvg/__init__.py in <module>()
>      25 import optparse
>      26
> ---> 27 from . import surface
>      28
>      29
>
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /site-packages/cairosvg/surface/__init__.py in <module>()
>      45
>      46 SHAPE_ANTIALIAS = {
> ---> 47     "optimizeSpeed": cairo.ANTIALIAS_FAST,
>      48     "crispEdges": cairo.ANTIALIAS_NONE,
>      49     "geometricPrecision": cairo.ANTIALIAS_BEST}
>
> AttributeError: 'module' object has no attribute 'ANTIALIAS_FAST'
> }}}
>
> I worked around this by modifying
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> /site-packages/cairosvg/surface/__init__.py and adding the following
> after the import statements
> {{{
> cairo.ANTIALIAS_FAST = cairo.ANTIALIAS_NONE
> cairo.ANTIALIAS_GOOD = cairo.ANTIALIAS_SUBPIXEL
> cairo.ANTIALIAS_BEST = cairo.ANTIALIAS_SUBPIXEL
> }}}

New description:

 {{{
 In [20]: import cairosvg
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-20-8605454d1a82> in <module>()
 ----> 1 import cairosvg

 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/cairosvg/__init__.py in <module>()
      25 import optparse
      26
 ---> 27 from . import surface
      28
      29

 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/cairosvg/surface/__init__.py in <module>()
      45
      46 SHAPE_ANTIALIAS = {
 ---> 47     "optimizeSpeed": cairo.ANTIALIAS_FAST,
      48     "crispEdges": cairo.ANTIALIAS_NONE,
      49     "geometricPrecision": cairo.ANTIALIAS_BEST}

 AttributeError: 'module' object has no attribute 'ANTIALIAS_FAST'
 }}}

 I worked around this by modifying
 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 /site-packages/cairosvg/surface/!__init!__.py and adding the following
 after the import statements
 {{{
 cairo.ANTIALIAS_FAST = cairo.ANTIALIAS_NONE
 cairo.ANTIALIAS_GOOD = cairo.ANTIALIAS_SUBPIXEL
 cairo.ANTIALIAS_BEST = cairo.ANTIALIAS_SUBPIXEL
 }}}

--

-- 
Ticket URL: <https://trac.macports.org/ticket/50785#comment:2>
MacPorts <https://www.macports.org/>
Ports system for OS X


More information about the macports-tickets mailing list