Running _07_flat_is_better_than_nested.py generates an error
Closed this issue · 1 comments
swedishmike commented
If I try to run _07_flat_is_better_than_nested.py it exits with the following error:
Traceback (most recent call last):
File "_07_flat_is_better_than_nested.py", line 2, in <module>
import ch_02_foundations._07_flat_support_file as s
ImportError: No module named ch_02_foundations._07_flat_support_file
So far I've found two fixes/workarounds.
-
Mark the directory 'write-pythonic-code-demos/code' as a 'Sources Root' in PyCharm.
-
Change the import statement to load _07_flat_support_file.py from the current directory.
Since not everyone taking this course will have PyCharm I guess that solution 2 might be the one that's most useful for the majority of people? I'll submit a PR to that effect in case you want to use solution 2.
mikeckennedy commented
Thanks Mike. Yeah, I think # 2 works, want to make it a PR?