最近在学习用户画像,然后用到gensim模块,在安装的过程中出了一些错误,故在此记录一下。
我使用anaconda安装,对应的是python3.7,电脑win10 64。
使用anaconda prompt直接pin install gensim下载的极慢,会出现中断,关键我是换了的国内清华镜像源的,仍然没有用,不知道为什么。后来打算直接下载.whl文件,然后在安装。
下面是具体过程,会出现我经历的所有错误和我的尝试:
- 在 https://pypi.tuna.tsinghua.edu.cn/simple/gensim/ 找到符合python版本 的.whl文件(我的anaconda对应的是python3.7版本,文件是 gensim-3.7.0-cp37-cp37m-win_amd64.whl),然后下载,我把文 件放在了 D:\python\anaconda里面。
- 在anaconda prompt里面直接输入pip install D:\python\anaconda\gensim-3.7.0-cp37-cp37m-win_amd64.whl会出现错误:
后来我又重新试了一次,仍然出现错误: - 这次我根据错误先下载botocore:
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple botocore
下载成功。 - 最后在把之前下载的gensim安装:
pip install D:\python\anaconda\gensim-3.7.0-cp37-cp37m-win_amd64.whl
然后就成功了。
注意:假如下载的.whl文件和python版本不一样会出现错误:
ERROR: gensim-3.7.0-cp37-cp37m-win32.whl is not a supported wheel on this platform.
关于pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple botocore,simple后面加上你要下载的名字,这是我在一个博客(https://blog.csdn.net/qq_43546676/article/details/102862731)中看到的,很好用,可以安装其他的库、包、模块。