I have a project called hwrt (see GitHub , PyPI ) with the following structure:
.
βββ bin
βββ docs
βββ hwrt
β βββ datasets
β β βββ crohme_eval.py
β β βββ __init__.py
β β βββ inkml.py
β β βββ README.md
β β βββ results.csv
β βββ __init__.py
β βββ misc: Not important for this question
β βββ selfcheck.py
β βββ serve.py
β βββ ... (more Python modules)
β βββ templates: Not important for this question
β βββ view.py
βββ LICENSE
βββ Makefile
βββ MANIFEST.in
βββ README.md
βββ requirements.txt
βββ setup.cfg
βββ setup.py
βββ tests: Not important for this question
My problem is that
$ python
>>> from hwrt.datasets import inkml
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named datasets
root/of/project$ python
>>> from hwrt.datasets import inkml
>>>
Note that the folder datasetshas __init__.py. So this is not a problem. One problem (?) Is that setuptools does not copy the dataset folder. Do I have to do anything else than put __init__.pyin a folder?
setup.py
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'name': 'hwrt',
'version': '0.1.217',
'author': 'Martin Thoma',
'author_email': 'info@martin-thoma.de',
'maintainer': 'Martin Thoma',
'maintainer_email': 'info@martin-thoma.de',
'packages': ['hwrt'],
'scripts': ['bin/hwrt', 'bin/backup.py',
'bin/test.py', 'bin/train.py',
'bin/create_testset_online_once.py'],
'package_data': {'hwrt': ['templates/*', 'misc/*']},
'platforms': ['Linux', 'MacOS X', 'Windows'],
'url': 'https://github.com/MartinThoma/hwrt',
'license': 'MIT',
'description': 'Handwriting Recognition Tools',
'long_description': ("A tookit for handwriting recognition. It was "
"developed as part of the bachelors thesis of "
"Martin Thoma."),
'install_requires': [
"argparse",
"theano",
"nose",
"natsort",
"PyYAML",
"matplotlib",
"nntoolkit",
"h5py",
"flask",
"flask-bootstrap",
"requests",
"six"
],
'keywords': ['HWRT', 'recognition', 'handwriting', 'on-line'],
'download_url': 'https://github.com/MartinThoma/hwrt',
'classifiers': ['Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Utilities'],
'zip_safe': False,
'test_suite': 'nose.collector'
}
setup(**config)