Skip to content
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

小提示,numpy没有指定版本 #124

Open
user73X opened this issue May 7, 2024 · 0 comments
Open

小提示,numpy没有指定版本 #124

user73X opened this issue May 7, 2024 · 0 comments

Comments

@user73X
Copy link

user73X commented May 7, 2024

现在是:2024年5月份
现在最新的numpy版本是2.4
但是目前在requirements-server.txt文件中,没有指定numpy的版本
如果直接运行会报错

AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

查资料后了解到这个是因为正在使用np.bool,而这在NumPy 1.20中已被弃用。
所以解决办法就是降级:
conda install numpy=1.20
pip install numpy==1.20
(我降到1.20没有报错,其他版本没试过)
希望最好是requirements-server.txt指定一下用的numpy版本

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

1 participant