当我根据these instructions运行以下命令时,该错误发生在第31行,如下所述。如何获得packages的多个值?

python setup.py config_fc --fcompiler=gnu95 \
         --f77flags='-fdefault-real-8' \
         --f90flags='-fdefault-real-8' build




from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
import os, sys

import sys

fflags= '-fdefault-real-8 -ffixed-form'

# TODO: Fix it so that these flags are default.

config = Configuration(
    'glmnet',
    parent_package=None,
    top_path=None
)


f_sources = ['glmnet/glmnet.pyf','glmnet/glmnet.f']

config.add_extension(name='_glmnet',sources=f_sources)
config_dict = config.todict()
if __name__ == '__main__':
    from numpy.distutils.core import setup
    setup(version='1.1-5',
          description='Python wrappers for the GLMNET package',
          author='David Warde-Farley',
          author_email='[email protected]',
          url='github.com/dwf/glmnet-python',
          license='GPL2',
          requires=['NumPy (>= 1.3)'],
          packages=['glmnet'],            ### LINE 31
          **config_dict)

最佳答案

Configuration(package_name).to_dict()结果已经包含packages=[package_name]条目。

通过将其包含在setup()config_dict映射中,两次为setup()提供了该关键字。您可以将其从setup()调用中删除(第31行):

setup(version='1.1-5',
      description='Python wrappers for the GLMNET package',
      author='David Warde-Farley',
      author_email='[email protected]',
      url='github.com/dwf/glmnet-python',
      license='GPL2',
      requires=['NumPy (>= 1.3)'],
      **config_dict)


我看到软件包added the packages line explicitly 4 years ago的作者;我强烈怀疑NumPy的行为此后已经改变。

您可能应该向项目提交another issue

关于python - TypeError:setup()为关键字参数“packages”获得了多个值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/20501646/

10-12 21:54