Skip to content

Ensure NumPy/Scipy are installed from conda-forge if using conda #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

swryan
Copy link
Contributor

@swryan swryan commented Jul 17, 2025

Summary

A user was getting errors after running the script in a conda environment without first installing SciPy (see below). This was traced to the fact that SciPy was getting installed from PyPI (as a dependency of pyoptsparse) and that package seemed to be incompatible with the other packages (e.g. lapack) that are installed from conda-forge by the script.

This change will install NumPy and Scipy from conda-forge before installing pyoptsparse if they are not installed, or re-install them from conda-forge if they were previously installed from PyPI. This only happens when conda is enabled.

Tests were added to the GitHub workflow to exercise these scenarios.

Also:

  • one of the tests in the matrix was updated to test with SciPy 1.16, which was released recently.
Traceback (most recent call last):
  File "/Users/hschilli/miniforge3/envs/aviary/lib/python3.13/site-packages/numpy/core/__init__.py", line 24, in <module>
    from . import multiarray
  File "/Users/hschilli/miniforge3/envs/aviary/lib/python3.13/site-packages/numpy/core/multiarray.py", line 10, in <module>
    from . import overrides
  File "/Users/hschilli/miniforge3/envs/aviary/lib/python3.13/site-packages/numpy/core/overrides.py", line 8, in <module>
    from numpy.core._multiarray_umath import (
        add_docstring,  _get_implementing_args, _ArrayFunctionDispatcher)
ImportError: dlopen(/Users/hschilli/miniforge3/envs/aviary/lib/python3.13/site-packages/numpy/core/_multiarray_umath.cpython-313-darwin.so, 0x0002): Symbol not found: _cblas_caxpy$NEWLAPACK
  Referenced from: <27F2E2CD-A30E-38A6-A06C-0F5D7A0C22DC> /Users/hschilli/miniforge3/envs/aviary/lib/python3.13/site-packages/numpy/core/_multiarray_umath.cpython-313-darwin.so
  Expected in:     <3B8CB844-AEA9-37CA-901A-0BDC04DC268D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate

Related Issues

  • Resolves #

Backwards incompatibilities

None

New Dependencies

None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant