pyhive的安装
說明名錄
- 連接hive數(shù)據(jù)庫
- linux下安裝pyhive
連接hive數(shù)據(jù)庫
連接hive數(shù)據(jù)庫,許多文章推薦pyhive包,經(jīng)過小仙女本人多次嘗試與周圍童鞋交流,發(fā)現(xiàn)window系統(tǒng)貌似無法使用pyhive,mmp!!!
所以window系統(tǒng)下,如何連接hive數(shù)據(jù)庫?
https://blog.csdn.net/Xiblade/article/details/82318294
有童鞋推薦使用happybase,沒有用過,但感覺是一個(gè)可以讓人快樂的python包
我選擇VMware和Ubantu,方法自行百度,坑很少
linux下安裝pyhive
安裝上了linux系統(tǒng),再安裝Anoconda,完畢之后打開命令行,依次輸入:
pip install saslpip install thriftpip install thrift-saslpip install pyhive然后你就發(fā)現(xiàn)安裝sasl和thrift-sasl又是各種坑,欸,連接一個(gè)hive數(shù)據(jù)庫簡直太難了!報(bào)錯(cuò)如下:
Collecting saslDownloading https://files.pythonhosted.org/packages/8e/2c/45dae93d666aea8492678499e0999269b4e55f1829b1e4de5b8204706ad9/sasl-0.2.1.tar.gz Requirement already satisfied: six in ./anaconda3/lib/python3.7/site-packages (from sasl) (1.12.0) Building wheels for collected packages: saslBuilding wheel for sasl (setup.py) ... errorERROR: Complete output from command /home/liuju/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-nc9goial/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8ytz4zr3 --python-tag cp37:ERROR: running bdist_wheelrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/saslcopying sasl/__init__.py -> build/lib.linux-x86_64-3.7/saslrunning egg_infowriting sasl.egg-info/PKG-INFOwriting dependency_links to sasl.egg-info/dependency_links.txtwriting requirements to sasl.egg-info/requires.txtwriting top-level names to sasl.egg-info/top_level.txtreading manifest file 'sasl.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'writing manifest file 'sasl.egg-info/SOURCES.txt'copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/saslcopying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/saslcopying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/saslrunning build_extbuilding 'sasl.saslwrapper' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/saslgcc -pthread -B /home/liuju/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/liuju/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.occ1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++In file included from sasl/saslwrapper.cpp:254:sasl/saslwrapper.h:22:10: fatal error: sasl/sasl.h: No such file or directory#include <sasl/sasl.h>^~~~~~~~~~~~~compilation terminated.error: command 'gcc' failed with exit status 1----------------------------------------ERROR: Failed building wheel for saslRunning setup.py clean for sasl Failed to build sasl Installing collected packages: saslRunning setup.py install for sasl ... errorERROR: Complete output from command /home/liuju/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-nc9goial/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o68u9xve/install-record.txt --single-version-externally-managed --compile:ERROR: running installrunning buildrunning build_pycreating buildcreating build/lib.linux-x86_64-3.7creating build/lib.linux-x86_64-3.7/saslcopying sasl/__init__.py -> build/lib.linux-x86_64-3.7/saslrunning egg_infowriting sasl.egg-info/PKG-INFOwriting dependency_links to sasl.egg-info/dependency_links.txtwriting requirements to sasl.egg-info/requires.txtwriting top-level names to sasl.egg-info/top_level.txtreading manifest file 'sasl.egg-info/SOURCES.txt'reading manifest template 'MANIFEST.in'writing manifest file 'sasl.egg-info/SOURCES.txt'copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/saslcopying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/saslcopying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/saslrunning build_extbuilding 'sasl.saslwrapper' extensioncreating build/temp.linux-x86_64-3.7creating build/temp.linux-x86_64-3.7/saslgcc -pthread -B /home/liuju/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/liuju/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.occ1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++In file included from sasl/saslwrapper.cpp:254:sasl/saslwrapper.h:22:10: fatal error: sasl/sasl.h: No such file or directory#include <sasl/sasl.h>^~~~~~~~~~~~~compilation terminated.error: command 'gcc' failed with exit status 1---------------------------------------- ERROR: Command "/home/liuju/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-nc9goial/sasl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o68u9xve/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-nc9goial/sasl/其實(shí)sasl包的官網(wǎng)上有說明:https://pypi.org/project/sasl/0.1.3/,大概意思就是sasl包依賴gcc
在安裝pyhive相關(guān)包之前安裝gcc,需要在命令行里輸入
然后就ojbk了!
總結(jié)
- 上一篇: 蓝桥杯 基础练习 杨辉三角形 JAVA
- 下一篇: linux离线安装pyhive所依赖的包