我尝试从here的源代码安装pykafka。我下载了“ pykafka-2.8.0.tar.gz”文件,然后尝试通过python setup.py develop
命令进行安装。但是,它告诉我一条错误消息TypeError: __init__() takes exactly 2 arguments (4 given)
。我想知道这里出什么问题了。
操作系统版本为CentOS Linux release 7.1.1503 (Core)
,Python版本为Python 2.7.5
。
P.S。错误消息:
test@test.com ~/fff/pykafka-2.8.0 # python setup.py develop
running develop
running egg_info
writing requirements to pykafka.egg-info/requires.txt
writing pykafka.egg-info/PKG-INFO
writing top-level names to pykafka.egg-info/top_level.txt
writing dependency_links to pykafka.egg-info/dependency_links.txt
writing entry points to pykafka.egg-info/entry_points.txt
reading manifest file 'pykafka.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pykafka.egg-info/SOURCES.txt'
running build_ext
building 'pykafka.rdkafka._rd_kafka' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/pykafka
creating build/temp.linux-x86_64-2.7/pykafka/rdkafka
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c pykafka/rdkafka/_rd_kafkamodule.c -o build/temp.linux-x86_64-2.7/pykafka/rdkafka/_rd_kafkamodule.o
pykafka/rdkafka/_rd_kafkamodule.c: In function 'RdkHandle_start':
pykafka/rdkafka/_rd_kafkamodule.c:492:9: warning: 'rd_kafka_errno2err' is deprecated (declared at /usr/include/librdkafka/rdkafka.h:57 ) [-Wdeprecated-declarations]
set_pykafka_error_from_code(rd_kafka_errno2err(errno), NULL);
^
pykafka/rdkafka/_rd_kafkamodule.c: In function 'Producer_produce':
pykafka/rdkafka/_rd_kafkamodule.c:682:9: warning: 'rd_kafka_errno2err' is deprecated (declared at /usr/include/librdkafka/rdkafka.h:57 ) [-Wdeprecated-declarations]
rd_kafka_resp_err_t err = rd_kafka_errno2err(errno);
^
pykafka/rdkafka/_rd_kafkamodule.c: In function 'Consumer_stop':
pykafka/rdkafka/_rd_kafkamodule.c:803:17: warning: 'rd_kafka_errno2err' is deprecated (declared at /usr/include/librdkafka/rdkafka.h:570) [-Wdeprecated-declarations]
set_pykafka_error_from_code(rd_kafka_errno2err(errno), NULL);
^
pykafka/rdkafka/_rd_kafkamodule.c: In function 'Consumer_start':
pykafka/rdkafka/_rd_kafkamodule.c:935:13: warning: 'rd_kafka_errno2err' is deprecated (declared at /usr/include/librdkafka/rdkafka.h:570) [-Wdeprecated-declarations]
set_pykafka_error_from_code(rd_kafka_errno2err(errno), NULL);
^
gcc -pthread -shared -Wl,-z,relro build/temp.linux-x86_64-2.7/pykafka/rdkafka/_rd_kafkamodule.o -L/usr/lib64 -lrdkafka -lpython2.7 -o /root/fff/pykafka-2.8.0/pykafka/rdkafka/_rd_kafka.so
Creating /usr/lib64/python2.7/site-packages/pykafka.egg-link (link to .)
pykafka 2.8.0 is already the active version in easy-install.pth
Installing kafka-tools script to /usr/bin
Installed /root/fff/pykafka-2.8.0
Traceback (most recent call last):
File "setup.py", line 196, in <module>
run_setup()
File "setup.py", line 183, in run_setup
"Topic :: Software Development :: Libraries :: Python Modules",
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/site-packages/setuptools/command/develop.py", line 27, in run
self.install_for_development()
File "/usr/lib/python2.7/site-packages/setuptools/command/develop.py", line 129, in install_for_development
self.process_distribution(None, self.dist, not self.no_deps)
File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 701, in process_distribution
distreq.project_name, distreq.specs, requirement.extras
TypeError: __init__() takes exactly 2 arguments (4 given)