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 trialfc3
Python Web Development Techdegree Student 9,205 PointsTo get ./diary to work on windows I used #!/usr/bin/env python
The only installation of Python I have on my machine currently is Python3. If I had python2 as well though then I would probably need to specify which version I wanted to run though right?
6 Answers
Steven Parker
231,248 PointsThe "shebang" (or "hashbang") is a Linux/Unix program loader directive. I would not expect it to be effective on a Windows system.
Ross Coe
5,061 Pointsthis is not working in workspaces - /usr/bin/env: 'python3\r' No such file or directory
Steven Parker
231,248 PointsTry it without the "\r".
Ross Coe
5,061 Pointsit was without the \r - that was part of the return error
Steven Parker
231,248 PointsIn that case, it sounds like your file is in Windows text format (CR/LF) and not Linux format (LF only).
Ross Coe
5,061 Pointsthis was in workspaces - though I found workspaces to be very cachey (?) sometimes if you run the exact same code in a different session and it will pass
Steven Parker
231,248 PointsThe workspaces use Linux. A "\r" is a return (CR) character, which should not be part of a Linux text file.
Ross Coe
5,061 PointsSteven - I just used the she-bang on a file I'm using now Python Testing - Writing and Running Doctests and it worked.. I let you know if I see the \r again
- I was in workspaces though (no "fake news" ;) )
Ross Coe
5,061 PointsSteven Parker - can you have a look at /decorators/dec.py in that workspace https://teamtreehouse.com/workspaces/39916452#
Steven Parker
231,248 PointsYou can't share a direct link to a workspace, it's temporary and only exists while you are using it. But you can make a snapshot and share the link to that.