Skip to content

P4D compatability with NumPy #499

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

Closed
UncleWael opened this issue Apr 30, 2025 · 5 comments
Closed

P4D compatability with NumPy #499

UncleWael opened this issue Apr 30, 2025 · 5 comments

Comments

@UncleWael
Copy link

When trying the Webinar II tutorials , PyVizSVG and PyChartHTML until now , this error keeps popping :

" A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.4 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with
NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. "

and this prevents me from using the package since it is not compatable with the new versions of Numpy as the error says. is there a solution from the Delphi side ? because
obviously I cannot downgrade the Numpy.

Context : Delphi 12.1 , Python 3.12.3 , Numpy 2.2.4

@pyscripter
Copy link
Owner

@UncleWael
Copy link
Author

yes ofcourse i googled it, and as i mentioned above , downgrading the Numpy is not an option (fix 1 in the link you sent) for obvious reasons, fix 2 is what i'm asking for : "install the latest version of the module which is failing" in our case , it is P4D

@pyscripter
Copy link
Owner

pyscripter commented May 1, 2025

"install the latest version of the module which is failing" in our case , it is P4D

P4D is not a python module. These demos make use of a number of python modules:

  • pandas
  • matplotlib
  • seaborn
  • mpld3
  • bokeh
  • altair
  • scikit-learn

and it appears that some of them are not yet compatible with numpy v2. You can easily find which one by importing them from the python CLI.

running pip install -U package_name

with each of the above will likely fix the error.

@pyscripter
Copy link
Owner

pyscripter commented May 1, 2025

I have checked the Webinar II demos with python 3.13 and updated versions of the python modules and they work (no import errors).
VizDemo was updated to make it compatible with recent versions of python.
The AnalyticsDemo needs some updating to make it compatible.

It will run if you replace in line 66:

bayesian_grid = {'tol': tol, 'alpha_1': alpha_1, 'alpha_2' : alpha_2, 'lambda_1': lambda_1, 'lambda_2' : lambda_2,
                 'normalize' : normalize}

with
bayesian_grid = {'tol': tol, 'alpha_1': alpha_1, 'alpha_2' : alpha_2, 'lambda_1': lambda_1, 'lambda_2' : lambda_2}

but the results are not correct.

@UncleWael
Copy link
Author

Ok , I will do and I will follow up. Thank you for help.

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

No branches or pull requests

2 participants