numpy和ehtim的问题

xqnpmsa8  于 2023-05-22  发布在  其他
关注(0)|答案(1)|浏览(122)

当我运行我的脚本时,昨天运行得很好。我现在得到错误消息:
C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation. Python. 3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io\oifits. py:71:未来警告:将来np.bool将被定义为对应的NumPy标量。from numpy import double,bool,ma Traceback(most recent call last):文件“C:\Users\chri\BA-Proj\astroray_io。py ",第1行,在import ehtim File" C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation。巨蟒3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim_* init . py”,第18行,来自ehtim。成像imager_utils import imager_func File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation。巨蟒3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\imaging\imager_utils. py”,第32行,在import ehtim中。映像为映像文件“C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation。巨蟒3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\image.py",line 47,in import www.example.com File" C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation。巨蟒3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io init . py”,第9行,来自。ehtim.io.save无法从“numpy”导入名称“bool”(C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation. Python. 3. 10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpy init *. py) import load File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io\load.py", line 35, in import ehtim.obsdata File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\obsdata.py", line 45, in import ehtim.io.save File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io\save.py", line 31, in import ehtim.io.writeoifits File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io\writeoifits.py", line 10, in import ehtim.io.oifits File "C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\ehtim\io\oifits.py", line 71, in from numpy import double, bool, ma ImportError: cannot import name 'bool' from 'numpy' (C:\Users\chris\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\numpyinit_.py)
我该怎么解决这个问题?
我已经尝试重新安装和检查所提到的模块的版本,但一切似乎都是为了。

mf98qq94

mf98qq941#

您需要从最新的numpy版本降级,这是导致问题的原因。如果你这样做:

pip install numpy==1.23.3

那应该对你有用
另请参阅讨论here-此问题已修复,但最新版本尚未在PyPI上发布。

相关问题