Altair pie chart error

I am getting the following error when trying to create an Altair pie chart. I have Altair bar charts, line charts and stacked bar charts all working properly. However, as soon as I try to create a pie chart I run into a fatal error. To eliminate any issues with my typing and incorrect encodings etc. I copied the example from the Altair documentation (Pie Chart — Altair 4.2.0 documentation). This also fails. I am not sure what I am doing incorrectly.

Hi @Gaurav_Kimothi, welcome to the Streamlit community!

It would be helpful to post the code that doesn’t work, that way someone can take a look and suggest what the fix might be.


Here it is. This is the example from the Altair documentation. I have no issues with bar chart (mark_bar) and line chart (mark_line). I am only running into this issue when trying to create a pie chart. Appreciate any help.

source = pd.DataFrame({"category": [1, 2, 3, 4, 5, 6], "value": [4, 6, 10, 3, 7, 8]})

    theta=alt.Theta(field="value", type="quantitative"),
    color=alt.Color(field="category", type="nominal"))

Make sure you have Altair 4.2 installed, which is when the mark_arc method was added:

Upgrading my local instance from Altair 4.1 to 4.2 with your code snippet displays a pie chart for me


Yes, that was it. Thank you!