gpt4 book ai didi

python - pip 安装 pydoop 问题

转载 作者:行者123 更新时间:2023-12-02 18:23:37 36 4
gpt4 key购买 nike

当我在 Ubuntu 16.0.4 中安装 pydoop 时,出现如下错误:

~$ pip install pydoop
Collecting pydoop
Using cached pydoop-1.2.0.tar.gz
Complete output from command python setup.py egg_info:
using setuptools version 27.2.0
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-Q8VQGn/pydoop/setup.py", line 70, in <module>
JVM_LIB_PATH, JVM_LIB_NAME = jvm.get_jvm_lib_path_and_name(JAVA_HOME)
File "pydoop/utils/jvm.py", line 93, in get_jvm_lib_path_and_name
return os.path.dirname(jvm_path), jvm_lib_name if jvm_path else None
File "/home/hadoop/anaconda2/lib/python2.7/posixpath.py", line 122, in dirname
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

JAVA_HOME 值为 /etc/java-8-openjdk

最佳答案

我在 HDP 节点 CentOS7 上尝试安装 pydoop 包时遇到了完全相同的错误。

在运行 pip install 之前,我手动将 JAVA_HOME 设置为以下路径。

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin

更多详情:这是安装包到 Python 2.7 时的错误

 File "/usr/lib64/python2.7/posixpath.py", line 129, in dirname
i = p.rfind('/') + 1
AttributeError: 'NoneType' object has no attribute 'rfind'

这里是安装包到3.6时的报错

 File "/usr/lib64/python3.6/posixpath.py", line 156, in dirname
p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

后来,我发现我犯了两个错误。1.没有安装JAVA SDK。2. JAVA_HOME 是正确的。安装SDK后,JAVA_HOME应该是

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64

之后,我就可以成功安装pydoop了。

关于python - pip 安装 pydoop 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43210314/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com