python setuptools entry point script can't find module
<p>I have the feeling I am missing some point here, and googling didn't get me far.</p>

<p>I am using <code>setuptools</code> for a command line script. All goes fine but after installation my own files are not "seen" by the automatically generated script of the entry-point. Imagine the following case:</p>

<p>file <code>a.py</code> contains:</p>

<pre><code>a = 12
</code></pre>

<p>file <code>__main__.py</code> contains:</p>

<pre><code>from a import a

def main():
    print(a)

if __name__ == '__main__':
    main()
</code></pre>

<p>file <code>__init__.py</code> is empty. File <code>setup.py</code> contains:</p>

<pre><code>from setuptools import setup, find_packages

setup(
    name='tep',
    packages=find_packages(),
    version='0.0.1',
    entry_points={
        'console_scripts': [
            'tep = tep.__main__:main'
        ]
    },
)
</code></pre>

<p>all are properly located in the directory structure:</p>

<ul>
<li>test_entry_point

<ul>
<li>tep

<ul>
<li>__init__.py</li>
<li>__main__.py</li>
<li>a.py</li>
</ul></li>
<li>setup.py</li>
</ul></li>
</ul>

<p>Locally all works well. But after installation:</p>

<pre><code>sudo -H python setup.py install
</code></pre>

<p>and invoking from a different shell either by using <code>tep</code> or by using <code>python -m tep</code>, I get the following error:</p>

<pre><code>ImportError: No module named 'a'
</code></pre>

<p>So the file <code>a.py</code> is not visible in the scope after installation . Any ideas?</p>

<p>thanks.</p>