当在eclipse上运行pydev调试器时,它会因为缺少共享库(即libffi和libssl)而出错,尽管这两个库都已安装
>locate libffi.so.7
/usr/lib/x86_64-linux-gnu/libffi.so.7
"/home/user1/.var/app/org.eclipse.Java/eclipse/plugins/org.python.pydev.core_10.2.1.202307021217/pysrc/_pydevd_bundle/pydevd_utils.py", line 9, in <module>
import ctypes
File "/home/user1/.pyenv/versions/3.11.5/lib/python3.11/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.7: cannot open shared object file: No such file or directory
将LD_LIBRARY_PATH添加到运行/调试配置并不能解决问题集:LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
1条答案
按热度按时间7rtdyuoh1#
设置正确的LD_LIBRARY_PATH是正确的解决方案,但是,在运行配置的环境选项卡中,最后有2个选项,默认值是“将环境附加到本机环境”
第二种选择是:'用指定的环境替换本机环境'
选择替换(第二个选项),解决了问题,库被正确加载
Happy Happy:)