【问题标题】:Python Packaging蟒蛇包装
【发布时间】:2012-09-27 20:03:45
【问题描述】:

试图创建一个 python 包。似乎工作,但我得到一个警告。 我的 setup.py 是:

#! /usr/bin/env python

from distutils.core import setup

setup(
    name='myPKG',
    version='0.02.01',
    url='http://someURL.02.01',
     packages=['scripts',
              'statistics'],
    author = 'Research-Team', 
    author_email = 'me@gmail.com',
    description='This is my package',
    scripts=['scripts/myScript.py'],
    entry_points={'console_scripts' : ['myCommandlineName = scripts.myScript:testRequireDecorator']},
    install_requires=['numpy >= 1.5.1', 'scipy >= 0.9.0', 'poster']
)

我收到以下警告。为什么,特别是前两个用户警告?

root@TK: python setup.py sdist
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
  warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running sdist
running check
package init file 'scripts/__init__.py' not found (or not a regular file)
reading manifest template 'MANIFEST.in'
no previously-included directories found matching '.git'
warning: no previously-included files matching '*.pyc' found under directory '.'
writing manifest file 'MANIFEST'
creating myPKG-0.02.01
creating myPKG-0.02.01/scripts
creating myPKG-0.02.01/statistics
making hard links in myPKG-0.02.01...
hard linking README -> myPKG-0.02.01
hard linking setup.py -> myPKG-0.02.01
hard linking scripts/myScript.py -> myPKG-0.02.01/scripts
hard linking statistics/RunningMedian.py -> myPKG-0.02.01/statistics
hard linking statistics/RunningStdev.py -> myPKG-0.02.01/statistics
hard linking statistics/__init__.py -> myPKG-0.02.01/statistics
Creating tar archive
removing 'myPKG-0.02.01' (and everything under it)

【问题讨论】:

标签: python package


【解决方案1】:

您正在使用 distutils,但您至少需要 setuptools 才能使用这些选项。

from setuptools import setup

【讨论】:

    猜你喜欢
    • 2021-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-27
    • 1970-01-01
    • 1970-01-01
    • 2019-01-08
    • 2010-10-21
    相关资源
    最近更新 更多