【问题标题】:Missing something fundamental with my (first) setup.py - Python 3.4我的(第一个)setup.py - Python 3.4 缺少一些基本的东西
【发布时间】:2016-09-03 02:34:06
【问题描述】:

我的 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'

【问题讨论】:

    标签: python-3.x setup.py


    【解决方案1】:

    py_modules 不是py_module

    “曾经有一个来自金星的女人......” - 中尉。数据

    【讨论】:

      猜你喜欢
      • 2018-08-13
      • 2015-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      • 2021-08-04
      相关资源
      最近更新 更多