Python 如何在 Windows 上安装 gensim
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38739250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install gensim on windows
提问by Felix Mueller
Not able to install gensim on windows.Please help me I need to gensim Immediately and tell me installation steps with More details and other software that needs to be installed before it. thanks
无法在 windows 上安装 gensim。请帮助我,我需要立即安装 gensim 并告诉我安装步骤以及更多详细信息和其他需要安装的软件。谢谢
回答by user3046442
First you need to install NumPy
then SciPy
and then Gensim
(assuming you already have Python
installed). I used Python 3.4
as I find it easier to install SciPy
using version 3.4.
首先,你需要安装NumPy
,然后SciPy
再Gensim
(假设你已经Python
安装)。我用过,Python 3.4
因为我发现SciPy
使用 3.4 版更容易安装。
Step 1) Install Numpy:
步骤1)安装Numpy:
Download numpy?1.13.1+mkl?cp34?cp34m?win32.whl
from here
numpy?1.13.1+mkl?cp34?cp34m?win32.whl
从这里下载
note that in cp34-cp34m
34 is version of Python
you are using. So download appropriate file
请注意,在cp34-cp34m
34 中是Python
您正在使用的版本。所以下载合适的文件
Open command prompt and go the folder in which you just downloaded the file and install Numpy
using following command:
打开命令提示符并转到刚刚下载文件的文件夹并Numpy
使用以下命令进行安装:
pip install numpy?1.13.1+mkl?cp34?cp34m?win32.whl
pip 安装 numpy?1.13.1+mkl?cp34?cp34m?win32.whl
You should get successfully installed numpymessage
您应该成功安装 numpy消息
Step 2) Install SciPy:
第 2 步)安装 SciPy:
Follow the same link as above and download the scipy?0.19.1?cp34?cp34m?win32.whl
file.
Install it using the same instructions than in Step 1 but with this file name. The command is the following:
按照与上面相同的链接下载scipy?0.19.1?cp34?cp34m?win32.whl
文件。使用与步骤 1 相同的说明进行安装,但使用此文件名。命令如下:
pip install scipy?0.19.1?cp34?cp34m?win32.whl
pip 安装 scipy?0.19.1?cp34?cp34m?win32.whl
You should get this message successfully installed scipy
您应该收到此消息已成功安装 scipy
Step 3) Install gensim:
步骤3)安装gensim:
Follow the link in step 1 and download gensim?2.3.0?cp34?cp34m?win32.whl
(the appropriate version for your system)
Install it using the instructions in Step 1 (with this file name) with following command:
按照步骤 1 中的链接并下载gensim?2.3.0?cp34?cp34m?win32.whl
(适用于您系统的版本)按照步骤 1 中的说明(使用此文件名)使用以下命令进行安装:
pip install gensim?2.3.0?cp34?cp34m?win32.whl
pip 安装 gensim?2.3.0?cp34?cp34m?win32.whl
You should get this message successfully installed gensim
您应该收到此消息已成功安装 gensim
Now in a Python
shell try:
现在在Python
shell 中尝试:
import gensim
进口原件
It should be successfully imported
应该可以成功导入
NOTES:Make sure pipis in your environment variables (add C:\python34\scriptsto your environment variable).
注意:确保pip在您的环境变量中(将C:\python34\scripts 添加到您的环境变量中)。
Make sure to download all the packages according to the Python
version you are using.
确保根据Python
您使用的版本下载所有软件包。
回答by Thomas N T
gensim
depends on scipy
and numpy
.You must have them installed prior to installing gensim
. Simple way to install gensim
in windows is, open cmd and type
gensim
取决于scipy
和numpy
。您必须在安装之前安装它们gensim
。gensim
在windows中安装的简单方法是,打开cmd并输入
pip install -U gensim
Or download gensim
for windows from
或gensim
从
https://pypi.python.org/pypi/gensim
https://pypi.python.org/pypi/gensim
then run
然后运行
python setup.py test
python setup.py install
回答by David
I struggled with this a bit today trying to figure out if I needed a python 2.7 environment or if I could use my 3.5. I ended up doing this from an Anaconda 3.5 install:
我今天有点挣扎,试图弄清楚我是否需要一个 python 2.7 环境或者我是否可以使用我的 3.5。我最终从 Anaconda 3.5 安装中做到了这一点:
conda install -c anaconda gensim=0.12.4
conda install -c anaconda gensim=0.12.4
After a few hours of trying various things, suddenly it all worked on 3.5. My error was that it kept failing to install Scipy. I tried starting over with the conda install and just worked.
在尝试了几个小时的各种事情之后,突然间它在 3.5 上运行了。我的错误是它一直无法安装 Scipy。我尝试从 conda 安装重新开始,然后就成功了。
回答by Abdul Qayyum
I strongly suggest using anaconda where the installation of all the packages is very easy.
我强烈建议使用 anaconda,其中所有软件包的安装都非常简单。
The command for installing genism and all of its necessary packages on windows using anaconda python 3.7 is below.
下面是使用 anaconda python 3.7 在 windows 上安装 genism 及其所有必要软件包的命令。
conda install -c anaconda gensim
回答by Felix Mueller
I followed the instruction on https://radimrehurek.com/gensim/install.htmlwhich then successfully installed the fast version of Gensim (3.8.0) on Windows:
我按照https://radimrehurek.com/gensim/install.html上的说明操作,然后在 Windows 上成功安装了快速版本的 Gensim (3.8.0):
conda install -c conda-forge gensim
PS: The following did NOTinstall the fast version on Windows:
PS:以下也不要在Windows上安装的快速版本:
conda install gensim