Q: ImportError: No module named 'games' when trying to import a module in PyCharm I am learning Python using python programming for the absolute beginner 3rd ed. Now in Chapter 9, When I coded a module called games (games.py file) in the project root directory, and tried to import it in another file called simple_game.py (which is also created in the same directory as games.py) using
import games

Python simply stated ImportError: No module named 'games'. I am wondering how to solve the issue in PyCharm (I am using it to do all the practises with the book).
PS. I am using Python 3.4.2 on Win 8.1 X64 with PyCharm 4.0.4.
[EDIT] I created another games.py by right-clicked the project folder and chose New->Python File and copy the code in the old games.py to the new one. Run simple_game and the import issue was gone. I guess it has something to do with how you create a python file in the project? As I usually just right-clicked the project folder and choose New->File and Register New File Type Association as Python files. This way, I found the python files in the project folder are unrecognized (shown as File for Type) if I checked them in the project directory. Also, don't forget to mark project folder as Sources Root in order to make the module name reference work.
thanks
