gpt4 book ai didi

python-3.x - Linux pyarrow undefined symbol

转载 作者:行者123 更新时间:2023-12-02 12:20:03 26 4
gpt4 key购买 nike

我正在运行 Python 3.7.2 并使用 Miniconda3 创建一个名为 test-env 的新环境。我已将 pyarrow 包从默认 channel 安装到此环境中;但是,当我尝试导入 pyarrow 时,Python 解释器给出了 undefined symbol 错误:

Import Error: /test-env/lib/python3.7/site-packages/pyarrow/lib.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK5arrow6Status8ToStringB5cxx11Ev

从 SO 上的其他线程中,我了解到这是由于编译器不兼容造成的。我不是开发人员,所以我不知道如何解决这个问题。

最佳答案

我通过 conda install 安装后遇到了同样的错误,在 conda uninstall 后,我执行了 pip install,问题消失了。

>>> import pyarrow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/dv6/anaconda3/envs/spark/lib/python3.6/site-
packages/pyarrow/__init__.py", line 54, in <module>
from pyarrow.lib import cpu_count, set_cpu_count
ImportError: /home/dv6/anaconda3/envs/spark/lib/python3.6/site-
packages/pyarrow/lib.cpython-36m-x86_64-linux-gnu.so: undefined symbol:
_ZNK5arrow5Field8B5cxx11Ev
>>> quit()

然后我 conda 卸载

(spark) dv6@dv6:~$ conda uninstall pyarrow

然后我pip安装

(spark) dv6@dv6:~$ pip install pyarrow --user
Collecting pyarrow
Downloading pyarrow-0.16.0-cp36-cp36m-manylinux2014_x86_64.whl (63.1 MB)
|████████████████████████████████| 63.1 MB 25 kB/s
Requirement already satisfied: numpy>=1.14 in
./anaconda3/envs/spark/lib/python3.6/site-packages (from pyarrow) (1.18.1)
Requirement already satisfied: six>=1.0.0 in
./anaconda3/envs/spark/lib/python3.6/site-packages (from pyarrow) (1.14.0)
Installing collected packages: pyarrow
Successfully installed pyarrow-0.16.0
(spark) dv6@dv6:~$ python -c "import pyarrow"
(spark) dv6@dv6:~$

这是我的 Python 版本

(spark) dv6@dv6:~$ python
Python 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 21:14:29)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

关于python-3.x - Linux pyarrow undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55051431/

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