赞
踩
首先,numpy版本和scipy版本不兼容。
UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.3 warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
且因为小白阶段反复pip和conda重复安装了不同版本numpy,因此先卸载所有numpy版本。
- conda remove numpy
-
- pip uninstall numpy
卸载过程中,查看conda list和pip list,发现确实存在版本不一致情况,而且遇到warning提醒tensorflow版本不匹配,这里没有卸载tensorflow,不知道为什么出现这个情况,但仍旧强行卸载了numpy和scipy。
查看conda list和pip list没有之后,重新conda安装了numpy和scipy,接下来却又出现这样的报错:
ModuleNotFoundError: No module named 'pytz'
不知道为什么,就无脑安装lpytz.
conda install pytz
接下来以为正常了,结果又出现了新的报错:
- Error processing line 1 of E:\envs\anaconda3\envs\tfenv\lib\site-packages\matplotlib-3.6.1-py3.8-nspkg.pth:
-
- Traceback (most recent call last):
- File "D:\anaconda3\envs\tfenv\lib\site.py", line 168, in addpackage
- exec(line)
- File "<string>", line 1, in <module>
- File "<frozen importlib._bootstrap>", line 568, in module_from_spec
- AttributeError: 'NoneType' object has no attribute 'loader'
- Remainder of file ignored
参考这个解决办法python - AttributeError: 'NoneType' object has no attribute 'loader' - Stack Overflow,删掉了路径D:\Anaconda3\envs\pytorch\Lib\site-packages下报错的.pth文件matplotlib-3.6.1-py3.8-nspkg.pth.
这下完全ok啦,版本不对应的问题解决!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。