通过anaconda使用setuptools版本26.1.1。我无法执行我的任何命令行脚本,包括我的软件包。
以下是我的setup.py的样子:
from setuptools import setup
config = {
'description': 'Tools to extract information from web links',
'author': 'Tailwind',
'author_email': 'grantdelozier@gmail.com',
'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)
运行python setup.py install
后,我的脚本放在/ opt / anaconda2 / bin中,但内容将替换为:
#!/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')
失败并出现以下错误:
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'