Skip to content

Import numpy fails #22

Description

@ncguilbeault

Description of issue

It seems that under certain circumstances, the latest versions of numpy (v2) are incompatible with the Bonsai.Scripting.Python package. After doing pip install numpy, attempting to import numpy in Bonsai will throw an error:

Bonsai.WorkflowRuntimeException: Error import numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there

Steps to reproduce

OS is Windows 11.
Python version is 3.12.
Numpy version is 2.1.3.
Create a virtual environment and install numpy inside. Attempt to import numpy in Bonsai and it will throw an error.

Solution

A quick fix is to install a lesser version of numpy, for example pip install numpy==1.26.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions