Install PySpice on Mac
Not obviously documented anywhere, PySpice requires Ngspice version 34 or lower. On Mac it’s not possible using brew to specify which version of libngspice to install, so we’ll have to build it from source.
- Look at the files for version 34 on Sourceforge https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/34/
- Find the source code as
ngspice-34.tar.gz, and click to download that - Unzip it with
tar -xzf ngspice-34.tar.gzand thencd ngspice-34 - Run the configuration script
./configure --with-ngshared --enable-xspice --disable-debug --prefix=/usr/local - Make
make - Install
sudo make install
Install the Python package for PySpice
-
pip install pyspice -
Might get some errors on missing packages; install them with
pip install antlr4-python3-runtime==4.12.0 bitstring cloudpickle holidays kazoo overrides pytzERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pyutils 0.0.14 requires antlr4-python3-runtime==4.12.0, which is not installed. pyutils 0.0.14 requires bitstring, which is not installed. pyutils 0.0.14 requires cloudpickle, which is not installed. pyutils 0.0.14 requires holidays, which is not installed. pyutils 0.0.14 requires kazoo, which is not installed. pyutils 0.0.14 requires overrides, which is not installed. pyutils 0.0.14 requires pytz, which is not installed.
-
Check the install with
pyspice-post-installation --check-install. If all went well with installing the correct version of ngspice, this should proceed well.
⬛