我遗漏了一些关于setup.py外观的基本信息。我尝试过很多很多调整但无济于事。请注意,由于我只是为一个模块安装了一个安装程序,因此我选择使用py_module = ['foo']
而不是pacakges = ['foo']
。我尝试了packages
另外的rss_parse
子目录,但仍然没有骰子。显然,文档中存在一些我误解或完全错过的内容。
目录:
~/rss_parse
|- __init__.py
|- README.md
|- rss_parse.py
|- setup.py
setup.py:
from setuptools import setup
setup(name = 'rss_parse',
version ='0.1.0b1',
description ='RSS feed parser: Takes a URL and configuration dict and '
'returns an iterable object containing feed `<items>`',
long_description = open('README.md', 'r').read(),
author = 'Alastair',
author_email = 'nope@nopenope.nope',
url = 'https://github.com/dev-dull/rss_parse',
license = 'MIT',
py_module = ['rss_parse'],
install_requires = ['arrow', 'lxml'],
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: RSS and Atom feed parsing.',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.4',
],
keywords = 'RSS parser xml news Atom feed',
)
安装:
user@linux:~/rss_parse$ python3 setup.py install --user
测试:
user@linux:~/rss_parse$ cd ~/Desktop # make sure python3 doesn't find it in ./
user@linux:~/Desktop$ python3
>>> import rss_parse
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'rss_parse'
答案 0 :(得分:0)
py_modules
不是py_module
。
&#34;曾经有一位来自维纳斯的女人......&#34; - Lt. Cmdr。数据