linux 测试pyhs2,python pyhs2 的安装操作

我就废话不多说了,大家还是直接看代码吧~

# 两个依赖包: sasl&thrift

The easier way I find to install sasl on windows 7 is to use the pre-compiled version from here : http://www.lfd.uci.edu/~gohlke/pythonlibs/

There is a direct link to the sasl librairies here : http://www.lfd.uci.edu/~gohlke/pythonlibs/#sasl just pick the one you need.

Then you install it using pip :

pip install sasl-0.1.3-cp27-none-win_amd64.whl

from setuptools import setup

setup(

name='pyhs2',

version='0.6.0',

author='Brad Ruderman',

author_email='bradruderman@gmail.com',

packages=['pyhs2', 'pyhs2/cloudera', 'pyhs2/TCLIService'],

url='https://github.com/BradRuderman/pyhs2',

license='LICENSE.txt',

description='Python Hive Server 2 Client Driver',

long_description=open('README.md').read(),

install_requires=[

"sasl",

"thrift",

],

test_suite='pyhs2.test',

tests_require=["mock"]

)

补充:windows7下给python3安装impyla的艰辛历程

安装环境标题已经给出了,linux下和python2下都很容易安装,我也不知道为什么python3反而这么蛋疼。就直接上干货吧,希望其他人少走弯路。

安装所需依赖

pip install ipython six bit_array thriftpy thrift_sasl==0.2.1 sasl impyla(admin下)

常见报错

error: command ‘C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1158

FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。

LINK : fatal error LNK1158: cannot run ‘rc.exe'

大致错误分析

解决办法

上https://www.lfd.uci.edu/~gohlke/pythonlibs找到依赖的包的二进制whl文件进行安装,区分cp36和cp37的,然后一个个安装,遇到哪个依赖库报错就在这个网站中找,用它们的包进行安装即可

3/20更新

这几天又发现了新问题:

1. 在重新安装开发环境时出现了

thriftpy.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol 'c'

2. 在linux上安装sasl这个库时,会出现依赖报错:error: command 'gcc' failed with exit status 1

感觉着实蛋疼,最后才找到了一劳永逸的解决办法,即使用anaconda安装impyla即可自动解决依赖问题:

conda install -c anaconda impyla

有时安装完impyla后还是会报thrift_sasl不存在的错误,可以用conda install -c anaconda thrift_sasl==0.2.1即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值