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 trialsuyuneo
4,502 PointsCommand not found error
Hi Team,
When I used the following code:
# make a list to hold our items
shopping_list = []
# print out instructions on how to use the app
print("What should we pick up at the store?")
print("Enter DONE to quit the app.")
# ask for new items
while True:
new_item = ("> ")
# be able to quit the app
if new_item == 'DONE':
break
# add new items to our list
shopping_list.append(new_item)
# print out the list
print("Here's your list:")
for item in shopping_list:
print(item)
I kept getting a bash: (whatever item I typed in) : command not found error. Please advise, thank you!
5 Answers
Sigurd Melsom
6,107 PointsWhat command are you typing in?
suyuneo
4,502 PointsHi Steven/ Sigurd
I am working on the shopping list program under the Python Basics course. The name of the file that contains this code is shopping_list.py.
Steven Parker
231,271 PointsYou didn't show the command you were using, but to start this program from the command line, I would expect you to enter:
python shopping_list.py
suyuneo
4,502 PointsHi Steven
I was using workspaces instead of command line.
Steven Parker
231,271 PointsThe "command line" I was referring to would be what you type into the Console window of the workspace. The same place you might get the "command not found" error.
suyuneo
4,502 PointsHi Steven
It would be treehouse:~/workspace$ python shopping_list.py.
Sorry, total newbie here.
Steven Parker
231,271 PointsYes, that's the command that should run your program. I only showed the part you type in.
If it's not working, then to facilitate a more complete analysis of the situation, make a snapshot of your workspace and post the link to it here.
Steven Parker
231,271 PointsSteven Parker
231,271 PointsWhat command are you typing and what is the name of the file that contains this code?