在python3中安装pyhs2的问题 [英] Problems installing pyhs2 in python3

查看:296
本文介绍了在python3中安装pyhs2的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用CentOS 6.5并希望访问远程配置单元服务器。但我无法安装pyhs2使用 pip install pyhs2



我已经安装了所有必需的依赖项: p>


  • gcc-c ++

  • python-devel.x86_64
  • cyrus-sasl-devel.x86_64


但是我仍然得到相同的错误:

  sasl失败的构建轮
无法构建sasl
安装收集的包:sasl,pyhs2
运行setup.py安装sasl
完成命令/ usr / local / bin / python3 -c的输出import setuptools,tokenize; __ file __ ='/ tmp / pip-build -vq9qfls4 / sasl / setup.py'; exec(compile(getattr(tokenize,'open ',open)(__ file __)。read()。replace('\r\\\
','\\\
'),__file__,'exec'))install --record / tmp / pip-bjam3ra0-record /install-record.txt --single-version-externally-managed --compile:
正在运行安装
正在运行生成
正在运行build_py
正在运行egg_info
正在写入顶层 - 级别名称到sasl.egg-info / top_ level.txt
将dependency_links写入sasl.egg-info / dependency_links.txt
写入sasl.egg-info / PKG-INFO
警告:manifest_maker:标准文件'-c'未找到

阅读清单文件'sasl.egg-info / SOURCES.txt'
阅读清单模板'MANIFEST.in'
编写清单文件'sasl.egg-info / SOURCES.txt '
正在运行build_ext
建立'_saslwrapper'扩展
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I / opt / include / python3。 4m -c sasl / saslwrapper.cpp -o build / temp.linux-x86_64-3.4 / sasl / saslwrapper.o
cc1plus:警告:命令行选项-Wstrict-prototypes适用于Ada / C / ObjC但不适用于C ++
sasl / saslwrapper.cpp:在成员函数'void saslwrapper :: ClientImpl :: interact(sasl_interact_t *)'中:
sasl / saslwrapper.cpp:341:warning:unused variable'input '
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I / opt / include / python3.4m -c sasl / saslw rapper_wrap.cxx -o build / temp.linux-x86_64-3.4 / sasl / saslwrapper_wrap.o
cc1plus:warning:命令行选项-Wstrict-prototypes适用于Ada / C / ObjC,但不适用于C ++
sasl / saslwrapper_wrap.cxx:函数'void SWIG_Python_AddErrorMsg(const char *)':
sasl / saslwrapper_wrap.cxx:884:错误:'PyString_AsString'未在此范围内声明
sasl / saslwrapper_wrap.cxx:在函数'PySwigClientData * PySwigClientData_New(PyObject *)'中:
sasl / saslwrapper_wrap.cxx:1275:错误:'PyClass_Check'未在此范围内声明
sasl / saslwrapper_wrap.cxx:In函数'PyObject * PySwigObject_format(const char *,PySwigObject *)':
sasl / saslwrapper_wrap.cxx:1348:错误:'PyString_FromString'未在此作用域中声明
sasl / saslwrapper_wrap.cxx:1350:错误:'PyString_Format'未在此范围中声明
sasl / saslwrapper_wrap.cxx:在函数'PyObject * PySwigObject_repr(PySwigObject *)'中:
sasl / saslwrapper_wrap.cxx:1380:错误:'PyString_AsString'未在此作用域中声明
sasl / saslwrapper_wrap.cxx:1380:错误:'PyString_FromFormat'未在此作用域中声明
sasl / saslwrapper_wrap.cxx:1388:error:'PyString_ConcatAndDel '在此范围内未声明
sasl / saslwrapper_wrap.cxx:在函数'int PySwigObject_print(PySwigObject *,FILE *,int)'中:
sasl / saslwrapper_wrap.cxx:1402:error:'PyString_AsString'没有在此范围中声明
sasl / saslwrapper_wrap.cxx:在函数'PyObject * PySwigObject_str(PySwigObject *)'中:
sasl / saslwrapper_wrap.cxx:1415:错误:'PyString_FromString'未在此处声明范围
sasl / saslwrapper_wrap.cxx:函数'PyTypeObject * _PySwigObject_type()':
sasl / saslwrapper_wrap.cxx:1624:错误:'强制'未在此范围内声明
sasl / saslwrapper_wrap.cxx:1624:error:expected'}'before数字常量
sasl / saslwrapper_wrap.cxx:1624:错误:'PyNum过多的初始值设定项berMethods'
sasl / saslwrapper_wrap.cxx:1624:error:从'PyObject *(*)(PyObject *,PyObject *)'无效转换为'PyObject *(*)(PyObject *,PyObject *,PyObject *) '
sasl / saslwrapper_wrap.cxx:1624:错误:从'PyObject *(*)(PyObject *,PyObject *,PyObject *)'无效转换为'PyObject *(*)(PyObject *)'
sasl / saslwrapper_wrap.cxx:1624:error:从'PyObject *(*)(PyObject *)'无效转换为'int(*)(PyObject *)'
sasl / saslwrapper_wrap.cxx:1624:error:无效从'int(*)(PyObject *)'转换为'PyObject *(*)(PyObject *)'
sasl / saslwrapper_wrap.cxx:1624:error:expected','or';'before numeric constant
sasl / saslwrapper_wrap.cxx:1604:warning:未使用变量'swigobject_doc'
sasl / saslwrapper_wrap.cxx:1606:警告:未使用变量'PySwigObject_as_number'
sasl / saslwrapper_wrap.cxx:1637:警告:函数中没有return语句返回非void
sasl / saslwrapper_wrap.cxx:在全局sc打开:
sasl / saslwrapper_wrap.cxx:1641:错误:预期在'if'之前的非限定id
从/usr/lib/gcc/x86_64-redhat-linux/4.4.7/包含的文件中。 ./../../../include/c++/4.4.7/stdexcept:38,从sasl / saslwrapper_wrap.cxx获得
:2542:
/ usr / lib / gcc / x86_64-redhat -linux / 4.4.7 /../../../../include/c ++/4.4.7/exception:35:error:expected'}'before end of line
/ usr / lib / gcc / x86_64-redhat-linux / 4.4.7 /../../../../include/c ++/4.4.7/exception:35:error:expected declaration before before end of line
error:命令'gcc'失败,退出状态1

--------------------------------- -------
命令/ usr / local / bin / python3 -cimport setuptools,tokenize; __ file __ ='/ tmp / pip-build-vq9qfls4 / sasl / setup.py'; exec编译(getattr(tokenize,'open',open)(__ file __)。read()。replace('\r\\\
','\\\
'),__file__,'exec'))install --record /tmp/pip-bjam3ra0-record/install-record.txt --single-version-external-managed -compilefa / tmp / pip-build-vq9qfls4 / sasl


解决方案这是Python3和依赖SASL的问题。 SASL目前编码为Python2。这可以通过错误'PyString_AsString没有在范围中声明'来看到。



如果可能,短期解决方案是使用Python2。长期来看,无论是对于Python3还是SASL依赖都需要更新,或者pyhs2需要使用不同的依赖。


I am using CentOS 6.5 and want to access a remote hive server. But I am unable to install pyhs2 using pip install pyhs2.

I have installed all the required dependencies:

  • gcc-c++
  • python-devel.x86_64
  • cyrus-sasl-devel.x86_64

But still I get the same error:

Failed building wheel for sasl
Failed to build sasl
Installing collected packages: sasl, pyhs2
Running setup.py install for sasl
Complete output from command /usr/local/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vq9qfls4/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bjam3ra0-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running egg_info
writing top-level names to sasl.egg-info/top_level.txt
writing dependency_links to sasl.egg-info/dependency_links.txt
writing sasl.egg-info/PKG-INFO
warning: manifest_maker: standard file '-c' not found

reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
running build_ext
building '_saslwrapper' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/opt/include/python3.4m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.4/sasl/saslwrapper.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sasl/saslwrapper.cpp: In member function ‘void saslwrapper::ClientImpl::interact(sasl_interact_t*)’:
sasl/saslwrapper.cpp:341: warning: unused variable ‘input’
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/opt/include/python3.4m -c sasl/saslwrapper_wrap.cxx -o build/temp.linux-x86_64-3.4/sasl/saslwrapper_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sasl/saslwrapper_wrap.cxx: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
sasl/saslwrapper_wrap.cxx:884: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PySwigClientData* PySwigClientData_New(PyObject*)’:
sasl/saslwrapper_wrap.cxx:1275: error: ‘PyClass_Check’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_format(const char*, PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1348: error: ‘PyString_FromString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1350: error: ‘PyString_Format’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_repr(PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1380: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1380: error: ‘PyString_FromFormat’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1388: error: ‘PyString_ConcatAndDel’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘int PySwigObject_print(PySwigObject*, FILE*, int)’:
sasl/saslwrapper_wrap.cxx:1402: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_str(PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1415: error: ‘PyString_FromString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyTypeObject* _PySwigObject_type()’:
sasl/saslwrapper_wrap.cxx:1624: error: ‘coercion’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1624: error: expected ‘}’ before numeric constant
sasl/saslwrapper_wrap.cxx:1624: error: too many initializers for ‘PyNumberMethods’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*)’ to ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ to ‘PyObject* (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*)’ to ‘int (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘int (*)(PyObject*)’ to ‘PyObject* (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: expected ‘,’ or ‘;’ before numeric constant
sasl/saslwrapper_wrap.cxx:1604: warning: unused variable ‘swigobject_doc’
sasl/saslwrapper_wrap.cxx:1606: warning: unused variable ‘PySwigObject_as_number’
sasl/saslwrapper_wrap.cxx:1637: warning: no return statement in function returning non-void
sasl/saslwrapper_wrap.cxx: At global scope:
sasl/saslwrapper_wrap.cxx:1641: error: expected unqualified-id before ‘if’
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/stdexcept:38,
                 from sasl/saslwrapper_wrap.cxx:2542:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:35: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:35: error: expected declaration before end of line
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/local/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vq9qfls4/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bjam3ra0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vq9qfls4/sasl

解决方案

This is an issue with Python3 and the dependency SASL. SASL is currently coded for Python2. This is seen with the error 'PyString_AsString not being declared in the scope'.

A short term solution, if possible, would be to use Python2. Long term, either the SASL dependency will need to be updated for Python3 or pyhs2 will need to use a different dependency.

这篇关于在python3中安装pyhs2的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆