Python Entry point 'console_scripts' not found
<p>I'm unable to import entry point console scripts in my python package. Looking for help debugging my current issue, as I have read every relevant post on the issue.</p>

<p>Here is what my directory structure looks like:</p>

<pre><code>âââ ContentAnalysis
âÂ Â  âââ __init__.py
âÂ Â  âââ command_line.py
âÂ Â  âââ document.py
âÂ Â  âââ entities.py
âÂ Â  âââ sentiment.py
âÂ Â  âââ summary.py
âÂ Â  âââ text_tokenize.py
âÂ Â  âââ tokens.py
âââ local-requirements.txt
âââ requirements.txt
âââ server-requirements.txt
âââ setup.py
âââ tests
    âââ tests.py
    âââ tests.pyc
</code></pre>

<p>Here is what my setup.py looks like</p>

<pre><code>from setuptools import setup

config = {
    'description': 'Tools to extract information from web links',
    'author': 'sample',
    'version': '0.1',
    'install_requires': ['nose'],
    'packages': ['ContentAnalysis'],
    'entry_points': {
        'console_scripts': ['content_analysis=ContentAnalysis.command_line:main'],
    },
    'name':'ContentAnalysis',
    'include_package_data':True
}

setup(**config)
</code></pre>

<p>I've installed the package and verified that content_analysis is reachable from the command line. I've also verified that my ContentAnalysis package is importable from the python interpreter from any cd in the computer. Yet I still get an "Entry point not found error on execution"</p>

<pre><code>grant@DevBox2:/opt/content-analysis$ content_analysis -l 'http://101beauty.org/how-to-use-baking-soda-to-reduce-dark-circles-and-bags-under-the-eyes/'
Traceback (most recent call last):
  File "/opt/anaconda2/bin/content_analysis", line 11, in &lt;module&gt;
    load_entry_point('ContentAnalysis==0.1', 'console_scripts', 'content_analysis')()
  File "/opt/anaconda2/lib/python2.7/site-packages/setuptools-26.1.1-py2.7.egg/pkg_resources/__init__.py", line 565, in load_entry_point
  File "/opt/anaconda2/lib/python2.7/site-packages/setuptools-26.1.1-py2.7.egg/pkg_resources/__init__.py", line 2588, in load_entry_point
ImportError: Entry point ('console_scripts', 'content_analysis') not found
</code></pre>

<p>Any help or tips towards debugging this is appreciated</p>

<p><strong>Edit #1:</strong></p>

<p>Attempting to debug the issue, I noticed the command_line is not reachable as a submodule within ContentAnalysis</p>

<pre><code>&gt;&gt;&gt; import ContentAnalysis
&gt;&gt;&gt; ContentAnalysis.tokens
&lt;module 'ContentAnalysis.tokens' from '/opt/anaconda2/lib/python2.7/site-packages/ContentAnalysis/tokens.pyc'&gt;
&gt;&gt;&gt; ContentAnalysis.command_line
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
AttributeError: 'module' object has no attribute 'command_line'
&gt;&gt;&gt; 
</code></pre>

<p>It appears that command_line is not being added to the relevant site_packages folder. </p>

<pre><code>grant@DevBox2:/opt/anaconda2/lib/python2.7/site-packages/ContentAnalysis$ ls
data          entities.py   __init__.pyc   summary.py        text_tokenize.pyc
document.py   entities.pyc  sentiment.py   summary.pyc       tokens.py
document.pyc  __init__.py   sentiment.pyc  text_tokenize.py  tokens.pyc
</code></pre>

<p>I wonder why?</p>

<p>Investigation of the relevant site-packages folder clued me that my <code>python setup.py install</code> command was not putting all the relevant files where they needed to be. </p>

<p>I'm still not 100% of the underlying cause of the issue, but I was only able to get my site-packages folder to truly update by passing setup.py the <code>--force</code> argument as in </p>

<pre><code>python setup.py install --force
</code></pre>

<p>Now my site-packages folder contains the relevant command_line.py, and the console entry point works as expected.</p>

python debian anaconda setuptools setup.py