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 trialJonathan Grieve
Treehouse Moderator 91,253 Pointscannot import utils render module
Trying to follow along with this note and my editor keeps telling me there's an error and cannot find the Python Utils render module.
I'm probably doing this the wrong way but I like to follow along with the code in VS Code and can't find the error on google. Help! :-)
from utils import render
$ python dataframes-combine.py
Traceback (most recent call last):
File "dataframes-combine.py", line 7, in <module>
from utils import render
ImportError: cannot import name 'render'
2 Answers
Barry Snowe
51,277 PointsNot to put too fine a point on it, but if you aren't using Binder there is no need to include that import. So for example, I'm following along in a Jupyter Notebook and it handles the rendering natively. You might also find fun extensions for VS Code that will implement that notebook-style interactivity.
Ave Nurme
20,907 PointsIt's an old post here but I am currently taking the Pandas course and also bumped into the same error. Barry's suggestion works as I, as well, follow along in a Jupyter Notebook (I have Anaconda installed on my computer).
In the code at Github there were these lines:
for label, value in balances.items():
render("The label {} has a value of {}".format(label, value))
So here, I just substituted 'render' with 'print' and everything worked.
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsThanks Michael, so it's not an official Python module as I was previously thinking? No wonder I was only finding brick walls. :)
Michael Hulet
47,913 PointsMichael Hulet
47,913 PointsNope, this is a Treehouse-specific thing, in this case, hence why Google wasn't being nearly as helpful as usual 😅
Peng Ren
4,119 PointsPeng Ren
4,119 Pointsafter i downloaded the file how where should i save it on my mac so my jupyter notebook can recognize it?