我是python的新成员&我正在尝试与Hadoop HDFS系统连接。我得到了下面的参考代码,我试图实现它,但是在导入包时显示了错误。在
from pyarrow import HdfsClient
# Using libhdfs
hdfs = HdfsClient('192.168.0.119', '50070', 'cloudera', driver='libhdfs')
Error: ImportError: cannot import name 'HdfsClient'
我甚至试图用“pip”安装它,但是
Could not find a version that satisfies the requirement HdfsClient (from versi ons: ) No matching distribution found for HdfsClient
然后我试着用“conda”,但又一次
Collecting package metadata: done Solving environment: failed
PackagesNotFoundError: The following packages are not available from current cha nnels:
- hdfsclient
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/free/win-64
- https://repo.anaconda.com/pkgs/free/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
实际上,我正尝试使用以下方法连接色调:
IP地址->192.168.0.119
端口名->50070
用户名->cloudera
密码->;cloudera
但没用。有谁能建议用更好的方式连接它,或者如何在Python3中导入“HdfsClient”包。在
HDFSClient
已弃用。您可能需要使用pyarrow.hdfs.connect
。 另外,请尝试pip freeze
查看相关库是否安装在python环境中。 例如相关问题 更多 >
编程相关推荐