Numpy library error

ValueError: numpy.dtype size changed, may indicate binary incompatibility. 
Expected 96 from C header, got 88 from PyObject

I deployed my app as a private app and it had no issues until 5 days ago. My requirements are:

streamlit>=1.28
pandas
numpy==1.26.4
plotly
matplotlib
folium
streamlit_folium
datetime
sqlalchemy
st-gsheets-connection

Which library is causing the problem?

Hard to tell without having the traceback.

Oh now it is working again. No idea why it happened?

I still have the problem

12:17:28] πŸ“¦ Processed dependencies!

────────────────────── Traceback (most recent call last) ───────────────────────
  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru  
  nner/script_runner.py:589 in _run_script                                      
                                                                                
  /mount/src/streamlit_scripts/show_knmi.py:7 in <module>                       
                                                                                
      4 import platform                                                         
      5                                                                         
      6                                                                         
  ❱   7 from show_knmi_functions.utils import show_weerstations, help,  list_t  
      8 from show_knmi_functions.does_rain_predict_rain import does_rain_predi  
      9 from show_knmi_functions.polar_plot import polar_plot, polar_debug      
     10 from show_knmi_functions.show_warmingstripes import show_warmingstripe  
                                                                                
  /mount/src/streamlit_scripts/show_knmi_functions/utils.py:5 in <module>       
                                                                                
      2 import numpy as np                                                      
      3 import streamlit as st                                                  
      4 import datetime as dt                                                   
  ❱   5 from skmisc.loess import loess                                          
      6                                                                         
      7 # C:\Users\rcxsm\Documents\python_scripts\streamlit_scripts\show_knmi_  
      8  # @pd.api.extensions.register_series_accessor("loess")                 
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/skmisc/loess/__init__.py:5  
  1 in <module>                                                                 
                                                                                
    48    Scatterplots. Journal of the American Statistical Association, 74:    
    49    pp. 829--836. 1979.                                                   
    50 """                                                                      
  ❱ 51 from ._loess import (                                                    
    52 β”‚   loess,                                                               
    53 β”‚   loess_anova,                                                         
    54 β”‚   loess_confidence_intervals,                                          
                                                                                
  in init _loess:1                                                              
────────────────────────────────────────────────────────────────────────────────
ValueError: numpy.dtype size changed, may indicate binary incompatibility. 
Expected 96 from C header, got 88 from PyObject

starting at streamlit_scripts/show_knmi.py at main Β· rcsmit/streamlit_scripts Β· GitHub

Worked also well until some days ago.

EDIT : It is already an issue at Github of Numpy and Pandas

You are going to need numpy<2 et least until scikit-misc becomes compatible with numpy 2.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.