Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#79787 - undefined symbol: npy_cabs

Attached to Project: Arch Linux
Opened by Martin Diehl (MartinDiehl) - Tuesday, 26 September 2023, 12:50 GMT
Last edited by Antonio Rojas (arojas) - Tuesday, 26 September 2023, 22:22 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Antonio Rojas (arojas)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: `import statsmodels.api` fails due to missing `undefined symbol: npy_cabs`


Additional info:
* package version(s): 0.14.0-1
* config and/or log files etc.

Steps to reproduce:
`import statsmodels.api` with normal numpy/scipy and AUR python versions (python-numpy-mkl, python-scipy-mkl)

full log is given below

```
ImportError: /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/_representation.cpython-311-x86_64-linux-gnu.so: undefined symbol: npy_cabs

In [2]: import statsmodels.api as sm
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[2], line 1
----> 1 import statsmodels.api as sm

File /usr/lib/python3.11/site-packages/statsmodels/api.py:138
136 from .regression.mixed_linear_model import MixedLM
137 from .regression.quantile_regression import QuantReg
--> 138 from .regression.recursive_ls import RecursiveLS
139 from .robust.robust_linear_model import RLM
140 from .stats import api as stats

File /usr/lib/python3.11/site-packages/statsmodels/regression/recursive_ls.py:14
11 from statsmodels.compat.pandas import Appender
13 from statsmodels.tools.data import _is_using_pandas
---> 14 from statsmodels.tsa.statespace.mlemodel import (
15 MLEModel, MLEResults, MLEResultsWrapper, PredictionResults,
16 PredictionResultsWrapper)
17 from statsmodels.tsa.statespace.tools import concat
18 from statsmodels.tools.tools import Bunch

File /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/mlemodel.py:34
31 import statsmodels.tsa.base.tsa_model as tsbase
33 from .news import NewsResults
---> 34 from .simulation_smoother import SimulationSmoother
35 from .kalman_smoother import SmootherResults
36 from .kalman_filter import INVERT_UNIVARIATE, SOLVE_LU, MEMORY_CONSERVE

File /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/simulation_smoother.py:11
9 import warnings
10 import numpy as np
---> 11 from .kalman_smoother import KalmanSmoother
12 from .cfa_simulation_smoother import CFASimulationSmoother
13 from . import tools

File /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/kalman_smoother.py:11
8 import numpy as np
9 from types import SimpleNamespace
---> 11 from statsmodels.tsa.statespace.representation import OptionWrapper
12 from statsmodels.tsa.statespace.kalman_filter import (KalmanFilter,
13 FilterResults)
14 from statsmodels.tsa.statespace.tools import (
15 reorder_missing_matrix, reorder_missing_vector, copy_index_matrix)

File /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/representation.py:10
8 import warnings
9 import numpy as np
---> 10 from .tools import (
11 find_best_blas_type, validate_matrix_shape, validate_vector_shape
12 )
13 from .initialization import Initialization
14 from . import tools

File /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/tools.py:14
12 from statsmodels.tools.data import _is_using_pandas
13 from scipy.linalg.blas import find_best_blas_type
---> 14 from . import (_initialization, _representation, _kalman_filter,
15 _kalman_smoother, _simulation_smoother,
16 _cfa_simulation_smoother, _tools)
19 compatibility_mode = False
20 has_trmm = True

File statsmodels/tsa/statespace/_initialization.pyx:1, in init statsmodels.tsa.statespace._initialization()

ImportError: /usr/lib/python3.11/site-packages/statsmodels/tsa/statespace/_representation.cpython-311-x86_64-linux-gnu.so: undefined symbol: npy_cab
```
This task depends upon

Closed by  Antonio Rojas (arojas)
Tuesday, 26 September 2023, 22:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-statsmodels 0.14.0-3
Comment by Antonio Rojas (arojas) - Tuesday, 26 September 2023, 15:58 GMT
Seems related to the new numpy meson build system. Building numpy with setup.py fixes this, but this is not a long term solution since it will no longer work with the upcoming Python 3.12.
Comment by Martin Diehl (MartinDiehl) - Tuesday, 26 September 2023, 16:37 GMT
I can't figure out how numpy on PyPi is build, but the numpy Conda package seems to use Meson (https://github.com/conda-forge/numpy-feedstock/blob/main/recipe/build.sh).

Another aspect to consider might be Cython: The statsmodels Conda package requires Cython < 3.0 (https://github.com/conda-forge/statsmodels-feedstock/blob/main/recipe/meta.yaml), while the Arch package is at 3.0.2
Comment by Antonio Rojas (arojas) - Tuesday, 26 September 2023, 18:03 GMT
> Another aspect to consider might be Cython

Cython discrepancy was my first thought, since our numpy is built with cython 3 and statsmodels with cython 0.x. But building numpy with cython 0.x doesn't make any difference, only switching back to setup.py does.
Comment by Martin Diehl (MartinDiehl) - Tuesday, 26 September 2023, 19:17 GMT Comment by Antonio Rojas (arojas) - Tuesday, 26 September 2023, 22:07 GMT
This is a packaging issue in numpy

Loading...