OSError: cannot load library ‘libngspice.so’

Viewed 897

Good afternoon community, I am writing to you because I have encountered the following error trying to simulate the following filter that appears in the documentation.

enter link description herel

The error is as follows.

2020-05-23 00:45:37,954 - PySpice.Spice.NgSpice.Shared.NgSpiceShared.new_instance - INFO - New instance for id 0
2020-05-23 00:45:37,955 - PySpice.Spice.NgSpice.Shared.NgSpiceShared._load_library - WARNING - Set locale LC_NUMERIC to C

---------------------------------------------------------------------------

OSError                                   Traceback (most recent call last)

<ipython-input-6-475d4280ae1b> in <module>()
----> 1 simulator = circuit.simulator(temperature=25, nominal_temperature=25)
      2 analysis = simulator.ac(start_frequency=1@u_Hz, stop_frequency=1@u_MHz, number_of_points=10,  variation='dec')

8 frames

/usr/local/lib/python3.6/dist-packages/cffi/api.py in _load_backend_lib(backend, name, flags)
    825         if first_error is not None:
    826             msg = "%s.  Additionally, %s" % (first_error, msg)
--> 827         raise OSError(msg)
    828     return backend.load_library(path, flags)
    829 
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'

I have installed all the dependencies, although I have run out of ideas, I am starting in the world of programming, however, they asked me for a job to simulate filters in the university. I need your help, if possible, a lot of fat in advance the characteristics of my system are ubuntu 18.04 , python 3.6.2, pyscpice 1.4.2 I already tried

apt-get install libngspice0 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libngspice0-dev
2 Answers

It looks like, the library ngspice not installed in the system. Please clarify the version of the operational system, because the dependencies problem sometimes really hard. Perhaps, the lines below could help:

  • Debian/Ubuntu package installation sudo apt install libngspice0

  • Redhat/Centos package installation sudo yum install libngspice

I am using Ubuntu 20.04 and this worked for me:

sudo apt update
sudo apt install libngspice0-dev

NOTE: I tried even installing libngspice and libngspice0, but nothing worked.

Related