离线安装python hdfs

在http://mirrors.aliyun.com/pypi/simple/下载docopt-0.6.2.tar.gzhdfs-2.6.0.tar.gz,解压先安装docopt,执行python3 setup.py install,同样方式安装hdfs-2.6.0.tar.gz
通过下面代码进行测试

from hdfs import *
import pandas as pd
client=InsecureClient("http://host1:9870",user='hdfs')
df1 = pd.DataFrame([[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6], [4, 5, 6, 7]],index=list('1234'), columns=list('ABCD'))
client.write('/tmp/abc.csv', df1.to_csv(header=False,index=False), encoding='utf-8',overwrite=True)
client.list('/tmp')

你可能感兴趣的:(离线安装python hdfs)