enthought / enthought/chaco

Choco on windows, Python38, example does not work

Open
#831 4 comments 0 reactions 1 assignee Claimed by @homosapien-lcy View on GitHub
Dominant language
Python
Stars
305
Forks
97
PR merge metrics
No merged PRs in 30d

Description

Hello,
I have this problem (the code had worked before, but now it does not work anymore):

**Problem Description**

When I execute the below python code example from your documentation page. I get this error message:

```
File "C:\Users\herbst\raypier_optics\test_chaco.py", line 10, in
from chaco.api import Plot, ArrayPlotData

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\chaco\api.py", line 343, in
from chaco.overlays.api import (

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\chaco\overlays\api.py", line 63, in
from chaco.overlays.layers.api import (

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\chaco\overlays\layers\api.py", line 11, in
from .status_layer import ErrorLayer, StatusLayer, WarningLayer

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\chaco\overlays\layers\status_layer.py", line 17, in
from enable.savage.svg.document import SVGDocument

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\document.py", line 27, in
from . import css

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\css\__init__.py", line 10, in
from .transform import transformList

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\css\transform.py", line 18, in
from enable.savage.svg.pathdata import number, maybeComma

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\pathdata.py", line 117, in
lineTo = Group(Command("L") + Arguments(coordinatePairSequence))

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\pathdata.py", line 29, in Command
return CaselessPreservingLiteral(char)

File "C:\Users\herbst\Anaconda3\envs\myRaypier38\lib\site-packages\enable\savage\svg\pathdata.py", line 43, in __init__
self.name = "'%s'" % matchString

AttributeError: can't set attribute

```

**Reproduction Steps:**
I used "pip install chaco" and "pip install --upgrade chaco" to install chaco.

```python

from numpy import linspace, sin
from traits.api import HasTraits, Instance
from traitsui.api import View, Item
from chaco.api import Plot, ArrayPlotData
from enable.api import ComponentEditor

class LinePlot(HasTraits):
plot = Instance(Plot)

traits_view = View(
Item('plot', editor=ComponentEditor(), show_label=False),
width=500,
height=500,
resizable=True,
title="Chaco Plot",
)

def _plot_default(self):
x = linspace(-14, 14, 100)
y = sin(x) * x**3
plotdata = ArrayPlotData(x=x, y=y)

plot = Plot(plotdata)
plot.plot(("x", "y"), type="line", color="blue")
plot.title = "sin(x) * x^3"
return plot

if __name__ == "__main__":
LinePlot().configure_traits()

```

**Expected behavior:**

I had hoped the example would work

**OS, Python version:** [Enter OS name and Python version]
Python 3.8.12 , Windows 10

Best regards,
Jonas

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.