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.

  1. Look at the files for version 34 on Sourceforge https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/34/
  2. Find the source code as ngspice-34.tar.gz, and click to download that
  3. Unzip it with tar -xzf ngspice-34.tar.gz and then cd ngspice-34
  4. Run the configuration script ./configure --with-ngshared --enable-xspice --disable-debug --prefix=/usr/local
  5. Make make
  6. Install sudo make install

Install the Python package for PySpice

  1. pip install pyspice

  2. Might get some errors on missing packages; install them with pip install antlr4-python3-runtime==4.12.0 bitstring cloudpickle holidays kazoo overrides pytz

    ERROR: 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.

  3. Check the install with pyspice-post-installation --check-install. If all went well with installing the correct version of ngspice, this should proceed well.