【问题标题】:OSError: cannot load library 'libngspice.so': libngspice.so on GOOGLE-COLABOSError:无法加载库 \'libngspice.so\':GOOGLE-COLAB 上的 libngspice.so
【发布时间】:2022-11-18 17:48:41
【问题描述】:

我正在尝试在 Google-Colab 上使用 PySpice,但它抛出了这个错误。

**OSError:** cannot load library 'libngspice.so': libngspice.so: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libngspice.so'

笔记:我已经用这个命令安装了 PySpice。

!pip install PySpice

并且,还尝试使用此命令。

!pip install git+https://github.com/FabriceSalvaire/PySpice

【问题讨论】:

    标签: google-colaboratory


    【解决方案1】:

    问题是您尚未将 libngspice0 安装到 Colab 实例中。由于 PySpice 依赖于此包,因此您必须先安装才能运行任何模拟。

    在 Colab 中,您可以按如下方式执行此操作:

    # install libc-6-dev dependency
    !apt update && apt -q install libc6-dev
    
    # download libngspice0 packages from debian and install
    !wget http://ftp.fr.debian.org/debian/pool/main/n/ngspice/libngspice0_30.2-1~bpo9+1_amd64.deb && apt install -q ./libngspice0_30.2-1~bpo9+1_amd64.deb
    !wget http://ftp.fr.debian.org/debian/pool/main/n/ngspice/libngspice0-dev_30.2-1~bpo9+1_amd64.deb && apt install -q ./libngspice0-dev_30.2-1~bpo9+1_amd64.deb
    
    # install pyspice using pip
    !pip install pyspice
    

    成功运行上述操作后,使用以下命令确认安装:

    !pyspice-post-installation --check-install
    

    如果以上运行没有任何问题,你应该可以开始了!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-29
      • 2019-11-17
      • 1970-01-01
      • 2020-06-07
      • 2020-12-06
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多