3

Using setuptools version 26.1.1 via anaconda. I'm unable to execute any of my command line scripts I'm including with my package.

Here is what my setup.py looks like:

from setuptools import setup

config = {
    'description': 'Tools to extract information from web links',
    'author': 'Tailwind',
    'author_email': '[email protected]',
    'version': '0.1',
    'install_requires': ['nose'],
    'packages': ['ContentAnalysis'],
    'package_data': {
        'ContentAnalysis': ['data/*/*/*.txt']
    },
    'scripts': ['bin/content_analysis'],
    'name':'ContentAnalysis',
    'include_package_data':True
}

setup(**config)

After running python setup.py install, my script is placed in /opt/anaconda2/bin but the content is replaced with:

#!/opt/anaconda2/bin/python
# EASY-INSTALL-SCRIPT: 'ContentAnalysis==0.1','content_analysis'
__requires__ = 'ContentAnalysis==0.1'
__import__('pkg_resources').run_script('ContentAnalysis==0.1', 'content_analysis')

which fails with the following error:

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 4, in <module>
    __import__('pkg_resources').run_script('ContentAnalysis==0.1', 'content_analysis')
  File "/opt/anaconda2/lib/python2.7/site-packages/setuptools-26.1.1-py2.7.egg/pkg_resources/__init__.py", line 744, in run_script
  File "/opt/anaconda2/lib/python2.7/site-packages/setuptools-26.1.1-py2.7.egg/pkg_resources/__init__.py", line 1491, in run_script
pkg_resources.ResolutionError: No script named 'content_analysis'
5
  • 1
    That's probably because you don't have it included in your MANIFEST.in file. Also, I'd use the entry points option Commented Aug 31, 2016 at 20:24
  • Why is it neccesary to include the script in a MANIFEST.in file? I would like for setuptools to stick the content_analysis script into the directory it is putting it, just leave the content of the script untouched. In older versions of setuptools, this was possible Commented Aug 31, 2016 at 21:11
  • For reference, I'm attempting to add a script in the first method described here Commented Aug 31, 2016 at 21:17
  • Were you ever able to resolve this? I'm having the same problem running conda 4.0.5 and setuptools 27.2.0 on Linux. Strangely, there is no problem installing the same package on Mac with conda 4.2.9 and setuptools 27.2.0. As far as I can tell, the wrapper scripts around the executables are the same. Commented Jan 7, 2017 at 18:39
  • It was a setuptools issue and not a conda issue, see this link. I also had another non-setuptools related issue that contributed to the error Commented Jan 7, 2017 at 21:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.