我在 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 但似乎没有 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
并在 /usr/lib64/python3.6/lib-dynload/ 中添加了一个链接 libexpat.so.1 -> /usr/lib/libexpat.so.1 但这并没有消除错误
请帮忙