bug1:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
这是numpy库和scipy库版本不兼容导致的。因为这段bug上面多次提到gensim库,而gensim库又是和numpy库和scipy息息相关的。检查了gensim库和pip库,没发现问题,都是最新版本的,所以我试着在numpy库和scipy库上找问题。
解决办法:
用cmd打开Python输入以下代码,让numpy库和scipy库兼容就好。
pip uninstall numpy
pip uninstall scipy
pip uninstall gensim
pip install numpy
pip install scipy
pip install gensim
参考文章: 使用gensim时出现的问题与解决_imapotato的博客-CSDN博客_gensim和numpy不兼容报错如下:---------------------------------------------------------------------------ModuleNotFoundError Traceback (most recent call last)<ipython-input-1-3821d4821701> in ...https://blog.csdn.net/K52hz/article/details/104422149
bug2:
这是在用Python安装gensim的4.0.0版本时弹出的错误。大致说的是软件包有问题,而不是pip。上Python官网一看,原来gensim的4.0.0版本的build已经显示是Failed的了。4.0.0版本是下载不了了,我也暂时没有解决办法,就下载个最新的版本吧,感觉也差不多。
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.30.30705\\bin\\HostX86\\x64\\link.exe' Failed with exit code 1120
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> gensim
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.