Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

I'm getting an AttributeError. Can someone help me? Thanks in advance.

I'm pasting the code from the teachers notes and getting the Attribute Error below. Can someone help me? Thanks.

AttributeError Traceback (most recent call last) Cell In[14], line 11 8 x = np.linspace(0, 2*np.pi, 2000) 9 y = np.sin(x) ---> 11 p = figure(title='simple line example', plot_height=300, plot_width=600, y_range=(-5,5)) 12 r = p.line(x, y, color='#2222aa', line_width=3) 14 def update(f, w=1, A=1, phi=0):

File ~\Anaconda3\envs\Bike-ShareProfitOptimization\lib\site-packages\bokeh\plotting_figure.py:190, in figure.init(self, *arg, **kw) 188 for name in kw.keys(): 189 if name not in names: --> 190 self.raise_attribute_error_with_matches(name, names | opts.properties()) 192 super().init_(*arg, **kw) 194 self.x_range = get_range(opts.x_range)

File ~\Anaconda3\envs\Bike-ShareProfitOptimization\lib\site-packages\bokeh\core\has_props.py:368, in HasProps.raise_attribute_error_with_matches(self, name, properties) 365 if not matches: 366 matches, text = sorted(properties), "possible" --> 368 raise AttributeError(f"unexpected attribute {name!r} to {self.class.name_}, {text} attributes are {nice_join(matches)}")

AttributeError: unexpected attribute 'plot_height' to figure, similar attributes are outer_height, height or min_height

Steven Parker
Steven Parker
231,248 Points

When posting code, always use Markdown formatting to preserve the code's appearance. This is particularly important with Python, where indentation controls program flow. An even better way to share code from a workspace is by sharing a snapshot (not a "screenshot") of your workspace.

It's also helpful to know what course and lesson you are referring to. Take a look at this video about Posting a Question.