[MacPorts] #50785: Can't import py27-cairosvg
#50785: Can't import py27-cairosvg ----------------------+-------------------------------- Reporter: darius@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: py27-cairosvg ----------------------+-------------------------------- {{{ 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> MacPorts <https://www.macports.org/> Ports system for OS X
#50785: Can't import py27-cairosvg ----------------------------+-------------------------------- Reporter: darius@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: py27-cairosvg | ----------------------------+-------------------------------- Comment (by darius@…): Never mind, it's not actually a python SVG library! Note to self: read documentation first. -- Ticket URL: <https://trac.macports.org/ticket/50785#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#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
#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 | ----------------------------+-------------------- Comment (by sean@…): Huh. I can reproduce this easily. Will investigate. -- Ticket URL: <https://trac.macports.org/ticket/50785#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#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 | ----------------------------+-------------------- Comment (by pavel+ports@…): hi, have the same error on OS X 10.9.5, Python 2.7.5 my script: {{{ Traceback (most recent call last): File "process.py", line 111, in <module> main() File "process.py", line 106, in main print _draw_graph(result, "%s.svg" % "report1") File "process.py", line 43, in _draw_graph raise e AttributeError: 'module' object has no attribute 'ANTIALIAS_FAST' }}} {{{ $ cairosvg -V Traceback (most recent call last): File "/usr/local/bin/cairosvg", line 24, in <module> import cairosvg File "/Library/Python/2.7/site-packages/cairosvg/__init__.py", line 27, in <module> from . import surface File "/Library/Python/2.7/site-packages/cairosvg/surface/__init__.py", line 47, in <module> "optimizeSpeed": cairo.ANTIALIAS_FAST, AttributeError: 'module' object has no attribute 'ANTIALIAS_FAST' }}} {{{ $ sudo port info cairo | head -1 cairo @1.14.6 (graphics) }}} -- Ticket URL: <https://trac.macports.org/ticket/50785#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts