PySpice-org / PySpice

Simulate electronic circuit using Python and the Ngspice / Xyce simulators
https://pyspice.fabrice-salvaire.fr
GNU General Public License v3.0
660 stars 174 forks source link

OSError: cannot load library '/usr/local/lib/libngspice.dylib' (MacOS) #194

Open BadeSummer opened 4 years ago

BadeSummer commented 4 years ago

Environment (OS, Python version, PySpice version, simulator)

Mac Catalina Version 10.15.4 Python3.7.4 PySpice 1.3.2 ngspice31

Expected Behaviour

Run the example in 8.4.2"Diode Characteristic Curve".

Actual Behaviour

Return an OSError

OSError: cannot load library '/usr/local/lib/libngspice.dylib': dlopen(/usr/local/lib/libngspice.dylib, 2): Symbol not found: _omp_set_num_threads
  Referenced from: /usr/local/lib/libngspice.dylib
  Expected in: flat namespace
 in /usr/local/lib/libngspice.dylib

Steps to reproduce the behaviour

I install PySpice with pip. Compile ngspice from source. Download examples from Github.
And just run python3 diode-characteristic-curve.py.


I can run ngspice isolated and file"libngspice.dylib" can be found in /usr/local/lib/. I was searching in many places such as Google, GitHub issue and still don't know how to solve it.

FabriceSalvaire commented 4 years ago

can you try to run the tool https://github.com/FabriceSalvaire/PySpice/blob/master/bin/check-installation