After installing my python project with setup.py
and executing it in 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
...
We assume we have the following structure of 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
#!/usr/bin/env python
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 install cookies
as root
with $ python setup.py install
and execute cookies
I get the following error: ImportError: No module named b
. How can I solve the problem.