pip3 抛出未定义的符号:XML_SetHashSalt
pip3 throws undefined symbol: XML_SetHashSalt
我在 oracle Linux EL7 上有 python 3.6.8
我使用
安装了 pip3
yum install python36-pip
然而,每当我调用 pip3 时,它都会出现库错误
pip3
Traceback (most recent call last):
File "/bin/pip3", line 8, in <module>
from pip import main
File "/usr/lib/python3.6/site-packages/pip/__init__.py", line 42, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "/usr/lib64/python3.6/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib64/python3.6/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: undefined symbol: XML_SetHashSalt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bin/pip3", line 12, in <module>
from pip._internal import main
File "/usr/lib/python3.6/site-packages/pip/__init__.py", line 42, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "/usr/lib64/python3.6/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib64/python3.6/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: undefined
symbol: XML_SetHashSalt
我试图查看是否有任何替代 pyexpat 的方法。*.so 但似乎有 none
下面最后一行的 ldd 是输出
[root@whf00jkd python3.6]# ldd /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007ffd76bf9000)
libexpat.so.1 => /scratch/oraofss/app/oraofss/product/18.0.0/client_1/lib/libexpat.so.1 (0x00007fec3a94a000)
libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007fec3a422000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fec3a206000)
libc.so.6 => /lib64/libc.so.6 (0x00007fec39e38000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fec39c34000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fec39a31000)
libm.so.6 => /lib64/libm.so.6 (0x00007fec3972f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fec3ad81000)
我搜索了 libexpat.so.1
[root@whf00jkd python3.6]# whereis libexpat.so.1
libexpat.so: /usr/lib/libexpat.so.1 /usr/lib/libexpat.so /usr/lib64/libexpat.so.1 /usr/lib64/libexpat.so
[root@whf00jkd python3.6]# ls -ltr /usr/lib/libexpat.so.1
lrwxrwxrwx. 1 root root 17 Apr 1 2019 /usr/lib/libexpat.so.1 -> libexpat.so.1.6.0
[root@whf00jkd python3.6]# ls -ltr /usr/lib64/libexpat.so.1
lrwxrwxrwx. 1 root root 17 Apr 1 2019 /usr/lib64/libexpat.so.1 -> libexpat.so.1.6.0
并添加了一个 link libexpat.so.1 -> /usr/lib/libexpat.so.1
在 /usr/lib64/python3.6/lib-dynload/ 中,但这并没有消除错误
请帮忙
libexpat.so.1
指向错误的位置。用
修复了它
export LD_LIBRARY_PATH=/lib64/:${LD_LIBRARY_PATH}
ldd /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007fff073f1000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f9ba53ce000)
libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007f9ba4ea9000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9ba4c8d000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9ba48bf000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f9ba46bb000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f9ba44b8000)
libm.so.6 => /lib64/libm.so.6 (0x00007f9ba41b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9ba5807000)
你是如何安装 Python 3 的?在我的 Oracle Linux 7 安装中,我从 ol7_latest 安装 python3 on yum.oracle.com:
$ yum info python3
Installed Packages
Name : python3
Arch : x86_64
Version : 3.6.8
Release : 13.0.1.el7
Size : 39 k
Repo : installed
From repo : ol7_latest
没有安装 python36-pip,pip3 可以正常工作,例如:
$ pip3 install --user cx_Oracle
Collecting cx_Oracle
Using cached https://files.pythonhosted.org/packages/16/1d/36ecde56e0522f1a1cea7b4d4333f88b1062e0c5287fc67f522ceacc053c/cx_Oracle-8.0.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: cx-Oracle
Successfully installed cx-Oracle-8.0.0
这就是为我解决问题的方法。我使用的是 Python 3.6,我尝试使用 PIP 安装模块。我收到以下错误。
ImportError: /opt/rh/rh-python36/root/usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: 未定义符号: XML_SetHashSalt
在 ldd 后面加上查找映射的路径。
ldd /opt/rh/rh-python36/root/usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
检查 - libexpat.so.1 的映射。在我的例子中,它指的是不正确的 oracle 路径——/u01/oracle/product/12.1.0.2/lib/libexpat.so.1
所以我把上面目录下的libexpat.so.1改名了
重命名后,再给ldd,应该指向/lib64/libexpat.so.1
映射更正后,我就可以进行 pip 安装了。
谢谢大家的帮助。
对我有帮助的链接:
https://ubuntuforums.org/showthread.php?t=2094005
https://askubuntu.com/questions/546654/python-error-when-opening-software-center
我遇到了完全相同的错误。
系统信息
- 装有 CentOS 7.9 的虚拟机
- Python 3.6
解决方案
我们安装了另一个软件,它带有自己的 libexpat 版本。我们还修改了环境变量 LD_LIBRARY_PATH 以包含该软件的 lib 目录。这导致 pip 加载错误的 库。
从 LD_LIBRARY_PATH 取消设置 LD_LIBRARY_PATH/removing 软件后,一切都很好。
我在 oracle Linux EL7 上有 python 3.6.8 我使用
安装了 pip3yum install python36-pip
然而,每当我调用 pip3 时,它都会出现库错误
pip3
Traceback (most recent call last):
File "/bin/pip3", line 8, in <module>
from pip import main
File "/usr/lib/python3.6/site-packages/pip/__init__.py", line 42, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "/usr/lib64/python3.6/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib64/python3.6/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: undefined symbol: XML_SetHashSalt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bin/pip3", line 12, in <module>
from pip._internal import main
File "/usr/lib/python3.6/site-packages/pip/__init__.py", line 42, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/usr/lib/python3.6/site-packages/pip/utils/__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "/usr/lib/python3.6/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
import plistlib
File "/usr/lib64/python3.6/plistlib.py", line 65, in <module>
from xml.parsers.expat import ParserCreate
File "/usr/lib64/python3.6/xml/parsers/expat.py", line 4, in <module>
from pyexpat import *
ImportError: /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: undefined
symbol: XML_SetHashSalt
我试图查看是否有任何替代 pyexpat 的方法。*.so 但似乎有 none 下面最后一行的 ldd 是输出
[root@whf00jkd python3.6]# ldd /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007ffd76bf9000)
libexpat.so.1 => /scratch/oraofss/app/oraofss/product/18.0.0/client_1/lib/libexpat.so.1 (0x00007fec3a94a000)
libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007fec3a422000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fec3a206000)
libc.so.6 => /lib64/libc.so.6 (0x00007fec39e38000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fec39c34000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fec39a31000)
libm.so.6 => /lib64/libm.so.6 (0x00007fec3972f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fec3ad81000)
我搜索了 libexpat.so.1
[root@whf00jkd python3.6]# whereis libexpat.so.1
libexpat.so: /usr/lib/libexpat.so.1 /usr/lib/libexpat.so /usr/lib64/libexpat.so.1 /usr/lib64/libexpat.so
[root@whf00jkd python3.6]# ls -ltr /usr/lib/libexpat.so.1
lrwxrwxrwx. 1 root root 17 Apr 1 2019 /usr/lib/libexpat.so.1 -> libexpat.so.1.6.0
[root@whf00jkd python3.6]# ls -ltr /usr/lib64/libexpat.so.1
lrwxrwxrwx. 1 root root 17 Apr 1 2019 /usr/lib64/libexpat.so.1 -> libexpat.so.1.6.0
并添加了一个 link libexpat.so.1 -> /usr/lib/libexpat.so.1 在 /usr/lib64/python3.6/lib-dynload/ 中,但这并没有消除错误
请帮忙
libexpat.so.1
指向错误的位置。用
export LD_LIBRARY_PATH=/lib64/:${LD_LIBRARY_PATH}
ldd /usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007fff073f1000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f9ba53ce000)
libpython3.6m.so.1.0 => /lib64/libpython3.6m.so.1.0 (0x00007f9ba4ea9000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9ba4c8d000)
libc.so.6 => /lib64/libc.so.6 (0x00007f9ba48bf000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f9ba46bb000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f9ba44b8000)
libm.so.6 => /lib64/libm.so.6 (0x00007f9ba41b6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9ba5807000)
你是如何安装 Python 3 的?在我的 Oracle Linux 7 安装中,我从 ol7_latest 安装 python3 on yum.oracle.com:
$ yum info python3
Installed Packages
Name : python3
Arch : x86_64
Version : 3.6.8
Release : 13.0.1.el7
Size : 39 k
Repo : installed
From repo : ol7_latest
没有安装 python36-pip,pip3 可以正常工作,例如:
$ pip3 install --user cx_Oracle
Collecting cx_Oracle
Using cached https://files.pythonhosted.org/packages/16/1d/36ecde56e0522f1a1cea7b4d4333f88b1062e0c5287fc67f522ceacc053c/cx_Oracle-8.0.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: cx-Oracle
Successfully installed cx-Oracle-8.0.0
这就是为我解决问题的方法。我使用的是 Python 3.6,我尝试使用 PIP 安装模块。我收到以下错误。
ImportError: /opt/rh/rh-python36/root/usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so: 未定义符号: XML_SetHashSalt
在 ldd 后面加上查找映射的路径。
ldd /opt/rh/rh-python36/root/usr/lib64/python3.6/lib-dynload/pyexpat.cpython-36m-x86_64-linux-gnu.so
检查 - libexpat.so.1 的映射。在我的例子中,它指的是不正确的 oracle 路径——/u01/oracle/product/12.1.0.2/lib/libexpat.so.1
所以我把上面目录下的libexpat.so.1改名了
重命名后,再给ldd,应该指向/lib64/libexpat.so.1
映射更正后,我就可以进行 pip 安装了。
谢谢大家的帮助。
对我有帮助的链接:
https://ubuntuforums.org/showthread.php?t=2094005
https://askubuntu.com/questions/546654/python-error-when-opening-software-center
我遇到了完全相同的错误。
系统信息
- 装有 CentOS 7.9 的虚拟机
- Python 3.6
解决方案
我们安装了另一个软件,它带有自己的 libexpat 版本。我们还修改了环境变量 LD_LIBRARY_PATH 以包含该软件的 lib 目录。这导致 pip 加载错误的 库。
从 LD_LIBRARY_PATH 取消设置 LD_LIBRARY_PATH/removing 软件后,一切都很好。