>>> import glumpy
/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/gloo/variable.py:82: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
gl.GL_BOOL : ( 1, gl.GL_BOOL, np.bool),
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/__init__.py", line 7, in <module>
from . import app
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/app/__init__.py", line 23, in <module>
from . console import Console
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/app/console.py", line 7, in <module>
from glumpy import gl, glm, gloo
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/gloo/__init__.py", line 7, in <module>
from . program import Program
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/gloo/program.py", line 16, in <module>
from . variable import gl_typeinfo, Uniform, Attribute
File "/home/mona/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy/gloo/variable.py", line 82, in <module>
gl.GL_BOOL : ( 1, gl.GL_BOOL, np.bool),
File "/home/mona/.local/lib/python3.10/site-packages/numpy/__init__.py", line 324, in __getattr__
raise AttributeError(__former_attrs__[attr])
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. Did you mean: 'bool_'?
字符串
我更改了以下文件行(clean-pvnet) mona@ada:~/anaconda3/envs/clean-pvnet/lib/python3.10/site-packages/glumpy$ vi gloo/variable.py
bool gl.GL_BOOL 1 gl.GL_BOOL np.bool
个
到bool gl.GL_BOOL 1 gl.GL_BOOL np.bool_
个
同样的错误。
尽管打开了一个新的终端选项卡和conda activate clean-pvnet
,但似乎模块没有重新加载。
2条答案
按热度按时间92dk7w1h1#
更新
glumpy
已更新,请执行字符串
老答案
潜在的问题是,
glumpy
在其需求中只有numpy
,而实际上,它应该是numpy<1.24
,因此一种解决方案也可以是只降级numpy。型
6qfn3psc2#
我只按照教程将其中一个
np.bool
转换为np.bool_
。我搜索了所有的np.bool
,并以类似的方式转换它们,错误消失了。字符串