Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

np.int was a deprecated alias for the builtin int. #1171

Open
a3678911 opened this issue Jun 1, 2023 · 17 comments
Open

np.int was a deprecated alias for the builtin int. #1171

a3678911 opened this issue Jun 1, 2023 · 17 comments

Comments

@a3678911
Copy link

a3678911 commented Jun 1, 2023

My version is R1.10.1. If my numpy's version is beyond or equal to R1.24.0, an error will output like this when skopt.space.Integer is used:
AttributeError: module 'numpy' has no attribute 'int'.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself.

This is how to fix it:
https://stackoverflow.com/questions/74844262/how-can-i-solve-error-module-numpy-has-no-attribute-float-in-python
Hope next version will fix it.

@mitramir55
Copy link

same issue.

@samihamine
Copy link

samihamine commented Jun 6, 2023

I have the same error.

return np.round(X_orig).astype(np.int)
Change it to:

return np.round(X_orig).astype(int)
in the file : skopt/space/transformers.py

EDIT : There is a PR #1159 but didn't pass the CI checks 🤔

@martin-kokos
Copy link

Another workaround:

np.int = np.int64

has worked for me for now.

@gorj-tessella
Copy link

Same issue

@jwelch1324
Copy link

There are several open PRs to fix this issue -- do we know if this project is being actively maintained/monitored?

@tfortimmy
Copy link

Seems like it is not: https://snyk.io/advisor/python/scikit-optimize

No update in two years

May be worth looking at other packages e.g. optuna

@rajdecca
Copy link

rajdecca commented Jul 4, 2023

Same issue

@SmokinCaterpillar
Copy link

Seems like it is not: https://snyk.io/advisor/python/scikit-optimize

No update in two years

May be worth looking at other packages e.g. optuna

Isn't optuna also relying (at least partly) on skopt?

@boemer00
Copy link

Hey, I have tried fixing this issue --> #1187
Hopefully, it will be sorted soon :)

@a3678911
Copy link
Author

Hey, I have tried fixing this issue --> #1187 Hopefully, it will be sorted soon :)

Good job! When will be the next Release Version released?

@Y-Srivaishnavi
Copy link

Tried fixing this issue too. Would not pass the tests - due to some version name inconsistency.

@baslia
Copy link

baslia commented Nov 28, 2023

same issue here :(

@breoganpardo
Copy link

Any information on when the issue will be solved in the library main branch?

@cloudy-sfu
Copy link

Same issue.

cloudy-sfu added a commit to cloudy-sfu/Transactions-pattern that referenced this issue Jan 13, 2024
@baslia
Copy link

baslia commented Jan 14, 2024

The easiest way is to fork the repo or copy locally and fix it.

@RNarayan73
Copy link

A workaround that worked for me is to put these lines before fitting the estimator:

import numpy as np
np.int = int

@svdcvt
Copy link

svdcvt commented Feb 14, 2024

Same issue, Is it hard to update just one line?

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

No branches or pull requests