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 trialPat McCarthy
9,800 Pointschmod +x diary.py ./diary.py
When I use this command, I get the following error:
chmod +x diary.py
./diary.py
./diary.py: line 1: $'\r': command not found
./diary.py: line 3: $'\r': command not found
./diary.py: line 4: import: command not found
./diary.py: line 5: $'\r': command not found
./diary.py: line 6: from: command not found
./diary.py: line 7: $'\r': command not found
./diary.py: line 8: syntax error near unexpected token ('
'/diary.py: line 8:
db = SqliteDatabase('diary.db')
Could anyone help me fix this?
2 Answers
Logan R
22,989 PointsDid you make sure to add "#!/usr/bin/env python3
" as the first line in your script?
Pat McCarthy
9,800 PointsYes I put the shebang in the .py file and saved it.