I have a folder structure :
setup_seplot.py
seplot/
__init__.py (empty)
seplot.py
kw_dictionaries.py
In seplot.py, I have :
import kw_dictionaries as kd
If I run seplot.py, everything works well.
However, there is a problem when I use setup_seplot.py :
python setup_seplot.py sdist bdist_wheel
Traceback (most recent call last):
File "setup_seplot.py", line 2, in <module>
from seplot import seplot as sep
File "/home/XXXXX/code/Python-Tools/seplot/seplot.py", line 14, in <module>
import kw_dictionaries as kd
ModuleNotFoundError: No module named 'kw_dictionaries'
This issue seems to come from the fact that in setup_seplot, I import seplot to get the version :
setup_seplot.py :
from setuptools import setup, Extension, find_packages
from seplot import seplot as sep
version=sep.__VERSION__
setup(
name='seplot',
version=version,
description="A front-end for Python PyX",
install_requires=[ 'pyx', ],
packages=find_packages(),
scripts=['seplot/bin/seplot','seplot/seplot.py',
'seplot/kw_dictionaries.py','seplot/style_dictionaries.py']
)
If in seplot.py I replace
import kw_dictionaries as kd
by :
from . import kw_dictionaries as kd
Then the setup works fine, but the code (setup.py) doesn't. I am quite lost here.