After installing my python project with setup.pyand running it in the terminal, I get the following error:
...
from ui.mainwindow import MainWindow
File "/usr/local/lib/python2.7/dist-packages/EpiPy-0.1-py2.7.egg/epipy/ui/mainwindow.py", line 9, in <module>
from model.sir import SIR
ImportError: No module named model.sir
...
Suppose we have the following structure for our project cookies:
.
βββ setup.py
βββ src
βββ a
β βββ aa.py
β βββ __init__.py
βββ b
β βββ bb.py
β βββ __init__.py
βββ __init__.py
βββ main.py
File: cookies/src/main.py
from a import aa
def main():
print aa.get_aa()
File cookies/src/a/aa.py
from b import bb
def get_aa():
return bb.get_bb()
File: cookies/src/b/bb.py
def get_bb():
return 'bb'
File: cookies/setup.py
import os
import sys
try:
from setuptools import setup, find_packages
except ImportError:
raise ImportError("Install setup tools")
setup(
name = "cookies",
version = "0.1",
author = "sam",
description = ("test"),
license = "MIT",
keywords = "test",
url = "asd@ads.asd",
packages=find_packages(),
classifiers=[
"""\
Development Status :: 3 - Alpha
Operating System :: Unix
"""
],
entry_points = {'console_scripts': ['cookies = src.main:main',],},
)
If I set cookiesboth rootwith $ python setup.py installand perform cookies, I get the following error: ImportError: No module named b. How can I solve the problem.