Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Object-Oriented Python Inheritance Multiple Superclasses

Getting error when trying to run play.py, I redid the video three times now still getting it.

When trying to run play.py I get error: python: can't open file 'play.py': [Errno 2] No such file or directory. Also have checked to make sure it is in the RPG folder

I am using python play.py I checked that the file was named play.py even copied file name to run it.

2 Answers

Steven Parker
Steven Parker
221,070 Points

Is the RPG folder your current working folder? You might need to "cd RPG" first. Or, you might invoke it from the root folder using "python RPG/play.py".

If neither of these work, try making a snapshot of your workspace and post the link to it here. That will enable us to replicate your issue.

Thank you, I thought I was losing my mind. Can't believe I forgot to change the directory.

I had the same problem and this is what I typed. python rpg/play.py and it worked if. If you will notice in the video his work space had the rpg/: already added to it but mine didn't. just something to watch for in future videos. Silas