python pyhs2 的安装操作

作者:Lucky-zhou 时间:2021-03-11 18:21:33 

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


# 两个依赖包: 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'

大致错误分析

一般上面的报错会出现在安装sasl ,thrift_sasl,和Bitarray时,推测是源码安装时pip与windows的兼容性问题,这时可以用二进制文件安装,参考https://stackoverflow.com/questions/44315943/error-installing-scrapy-error-command-c-program-files-x86-microsoft-visu中第一个回答下的第二条回复

解决办法

上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即可

参考:https://stackoverflow.com/questions/39220102/error-import-impyla-library-on-windows

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。如有错误或未考虑完全的地方,望不吝赐教。

来源:https://blog.csdn.net/Luckyzhou_/article/details/69945092

标签:python,pyhs2,安装
0
投稿

猜你喜欢

  • 你的网页“面目全非”过吗?

    2010-07-02 16:24:00
  • IE下修改<p>标签的innerHTML出错

    2007-11-11 10:12:00
  • php中获取指定IP的物理地址的代码(正则表达式)

    2023-11-23 07:04:36
  • 使用JScript遍历Request表单参数集合

    2011-02-26 11:08:00
  • PHP实现ASCII码与字符串相互转换的方法

    2023-09-09 13:27:05
  • 我喜欢你 抖音表白程序python版

    2023-06-11 12:54:17
  • 效控制C#中label输出文字的长度,自动换行

    2023-07-22 04:02:49
  • 5个css+div导航菜单

    2011-04-29 12:38:00
  • 高性能PHP框架Symfony2经典入门教程

    2023-11-16 02:39:23
  • php反序列化之魔术方法超详细讲解

    2023-11-16 07:24:59
  • php桥接模式的实例用法及代码分析

    2023-11-18 15:46:33
  • 五大提高ASP运行效率的技巧

    2007-09-20 13:15:00
  • 常用ASCII 码对照表

    2007-08-21 14:35:00
  • 自然描述与自然任务

    2010-01-26 15:51:00
  • Favicon图标小常识

    2010-04-01 12:01:00
  • Python学习之不同数据类型间的转换总结

    2021-10-04 06:06:57
  • YUI3.3.0 中 transition 事件的变化

    2011-06-16 20:51:45
  • 理清mysql外链的含义和命令

    2010-03-09 15:55:00
  • 如何编写一个基于WEB的文件查询系统?

    2009-11-08 18:55:00
  • MySql循环插入数据

    2010-10-14 13:50:00
  • asp之家 网络编程 m.aspxhome.com