pythonchaco

AttributeError: can't set attribute after import chaco.api


I installed chaco library on windows server 2012 after too much headache but I faced a big problem after installation :

pip install chaco Requirement already satisfied: chaco in c:\programdata\anaconda ... Requirement already satisfied: enable>=5.2.0 in c:\programdata\ ... Requirement already satisfied: numpy in c:\programdata\anaconda ... Requirement already satisfied: traits>=6.2.0 in c:\programdata\ ... Requirement already satisfied: pyface>=7.2.0 in c:\programdata\ ... Requirement already satisfied: traitsui in c:\programdata\anaco ... Requirement already satisfied: fonttools in c:\programdata\anac ... Requirement already satisfied: pillow in c:\programdata\anacond ... Requirement already satisfied: importlib-metadata in c:\program ... Requirement already satisfied: importlib-resources>=1.1.0 in c: ... Requirement already satisfied: zipp>=3.1.0 in c:\programdata\an ...

but after I import Chaco I get an error from "enable":

from chaco.api import (
    DataView,
    ArrayDataSource,
    ScatterPlot,
    LinePlot,
    LinearMapper,
    BarPlot,
    PlotAxis,
    FilledLinePlot,
    add_default_grids,
    Legend,
    PlotGraphicsContext,
    DataRange1D,
    VPlotContainer,
    PlotLabel,
    DataLabel, )

and this is my runtime error :

Traceback (most recent call last): File "c:\tsetmc\botsar.py", line 41, in from chaco.api import ( File "C:\ProgramData\Anaconda3\lib\site-packages\chaco\api.py", line 343, in from chaco.overlays.api import ( File "C:\ProgramData\Anaconda3\lib\site-packages\chaco\overlays\api.py", line 63, in from chaco.overlays.layers.api import ( File "C:\ProgramData\Anaconda3\lib\site-packages\chaco\overlays\layers\api.py", line 11, in from .status_layer import ErrorLayer, StatusLayer, WarningLayer File "C:\ProgramData\Anaconda3\lib\site-packages\chaco\overlays\layers\status_layer.py", line 17, in from enable.savage.svg.document import SVGDocument File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\document.py", line 27, in from . import css File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\css_init_.py", line 10, in from .transform import transformList File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\css\transform.py", line 18, in from enable.savage.svg.pathdata import number, maybeComma File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\pathdata.py", line 118, in lineTo = Group(Command("L") + Arguments(coordinatePairSequence)) File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\pathdata.py", line 29, in Command return CaselessPreservingLiteral(char) File "C:\ProgramData\Anaconda3\lib\site-packages\enable\savage\svg\pathdata.py", line 44, in init self.name = "'%s'" % matchString AttributeError: can't set attribute

Does anyone have any idea to solve this issue? I could have installed Chaco last year but this error never happen before and I don't know what to do


Solution

  • The problem might be because of updates in 'enable' API.

    I removed the self.name in pathdata.py and I got the error that customName cannot be found! Therefore, I change self.Name to self.customName and it solved