0
votes

I have several .py files in my Google App Engine project and I decided to group them together in a directory. However when I tried to access one I get an error:

ImportError: No module named edf

Previously my directory structure was:

app_name
-edf.py
-jkl.py

Now it is

app_name
-folder_name
--edf.py
--jkl.py

I tried to change the app.yaml line

- url: /edf
  script: folder_name/edf
1
try with a dot instead of : - Paul Collingwood
Can you please elaborate. - Bilbo Baggins
missing __ init __.py? - Dmytro Sadovnychyi
I just added an empty init file but I still get the same error. - Bilbo Baggins
script: folder_name.edf - Paul Collingwood

1 Answers

1
votes

You should use the dot character '.' to separate the paths rather than the colon in your original example.

On some operating systems \ is used to separate paths, and in some / is used. So python uses . instead to be os-independent at that level.

You can read some discussion on this here: https://www.python.org/dev/peps/pep-0328/