Skip to content

Working macOS conda environment for PyNN 0.12.4 with NEST 3.8, and NumPy compatibility notes #835

@adiehl96

Description

@adiehl96

Hey,

I wanted to share a conda environment that I was able to use successfully for PyNN 0.12.4 with the NEST 3.8 backend on macOS Apple Silicon (M1).

The main issues I encountered were:

  • Building/loading the PyNN NEST extensions on macOS.
  • Compatibility issues with newer NumPy releases.

The environment below was tested on:

  • macOS (Apple Silicon / ARM64)
  • MacBook Air M1
  • Miniforge / conda-forge
  • Python 3.12
  • NEST 3.8
  • PyNN 0.12.4
# Environment tested on:
#   macOS, Apple Silicon / ARM64
#   MacBook Air M1
#   Miniforge / conda-forge
#
# For Intel Macs, replace:
#   clangxx_osx-arm64 -> clangxx_osx-64
#   clang_osx-arm64   -> clang_osx-64

name: nest_env

channels:
  - conda-forge

dependencies:
  - python=3.12
  - nest-simulator=3.8
  - cmake<4
  - boost-cpp=1.85
  - clangxx_osx-arm64<20
  - clang_osx-arm64<20
  - pip
  - numpy<2.1
  - scipy
  - matplotlib
  - ipython
  - pip:
      - PyNN==0.12.4

The PyNN NEST extension module loaded successfully with this environment.

My observations regarding the failures with newer NumPy versions were the following:

  • NumPy 2.4.6 triggered errors involving np.in1d.
  • NumPy 2.1.3 through 2.3.5 triggered Calling nonzero on 0d arrays is not allowed. on line 209, in _standard_connect

After pinning numpy<2.1, basic PyNN/NEST simulations, recording, synaptic connectivity, and extension loading all worked correctly in my tests.

I’ve attached a small test script (check_pynn_nest.py) that tests current injection, synaptic connectivity, and extension loading. The script is not part of PyNN and was only used for quick sanity checks, but it may help reproduce the errors I encountered with newer versions of numpy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions