У меня есть небольшое приложение на Python3, но оно не будет запущено из-за того, что модуль не найден. Я добавил __init__.py
для всех папок уже, но он не работает. Мне интересно, почему.Makefile не может найти модуль в Python3
Вот моя структура
my_project
|- __init__.py
|
|-- folder
|-code.py
|- __init__.py
|
|-- Makefile
|-- scripts
|- import_data.py
Вот мой Makefile
test:
py.test tests/*.py
create_graph:
python scripts/import_data.py
А вот мой import_data.py
from folder.code import method
import csv
method()
# doing something here
Когда я бегу make create_graph
Это дает мне это.
python scripts/import_data.py
Traceback (most recent call last):
File "scripts/import_data.py", line 1, in <module>
from folder.code import method
ImportError: No module named 'folder'
make: *** [create_graph] Error 1