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 Introducing Lists Meet Lists Addition

Edward Randall
Edward Randall
1,834 Points

why does it say bash command not found when I run my program

title

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Perhaps you need one or more of the following:

:point_right: include a “python” before it

:point_right: add current directory to PATH

:point_right: add . (“dot”, current directory to PATH)

:point_right: execute using ./ (“dot slash”) before your program name

:point_right: verify “shebang” correctly points to a python executable (e.g., #!/usr/bin/env python3)

:point_right: make sure program is executable

$ chmod +x program_name

Post back if you need more help. Good luck!!!

Edward Randall
Edward Randall
1,834 Points

i understand your first suggestion. However, the next 5 I am lost. Could you further explain

Chris Freeman
Chris Freeman
Treehouse Moderator 68,457 Points

Each of the other options are alternative ways to make a python script run if you wanted to try to execute without including python on the command line. In a Linux shell, the command line is interpreted by the shell. The first token is assumed to be an executable, but which one. These other options are ways to hint at the desired executable.