python 想要一个旧版本的库,我没有,但我有一个新的

python wants an old version of the library, which I don't have, but I have a new one

我根本无法在 python 中编程。我只是想 运行 编写在 python 中的 grgsm (gnu radio gsm) 程序。我收到以下错误:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/grgsm/__init__.py", line 48, in <module>
from .grgsm_swig import *
  File "/usr/lib/python3.8/site-packages/grgsm/grgsm_swig.py", line 13, in <module>
    from . import _grgsm_swig
ImportError: libboost_program_options.so.1.71.0: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/grgsm_livemon", line 37, in <module>
from grgsm import arfcn
  File "/usr/lib/python3.8/site-packages/grgsm/__init__.py", line 48, in <module>
from .grgsm_swig import *
  File "/usr/lib/python3.8/site-packages/grgsm/grgsm_swig.py", line 13, in <module>
from . import _grgsm_swig
ImportError: libboost_program_options.so.1.71.0: cannot open shared object file: No such file or directory

从上面的消息中,我得出结论,在文件“/usr/lib/python3.8/site-packages/grgsm/grgsm_swig.py”的第 13 行中导入了文件 "libboost_program_options.so.1.71.0",哪个不见了。嗯,但是在这个文件的第 13 行没有任何内容。它看起来像这样:

# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
    raise RuntimeError("Python 2.7 or later required")

# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _grgsm_swig                # 13th line
else:
    import _grgsm_swig

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

我也不知道为什么 python 想要这个版本的 boost。如果我知道它是从哪里导入的,我会简单地将它更改为没有版本后缀的 libboost_program_options.so(因为我当然安装了 boost)。

可以找到解决方案here。一般先卸载,再按照正确的顺序重新安装依赖。