How to install gensim on windows - python

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

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.
Step 1) Install Numpy:
Download numpy‑1.13.1+mkl‑cp34‑cp34m‑win32.whl from here
note that in cp34-cp34m 34 is version of Python you are using. So download appropriate file
Open command prompt and go the folder in which you just downloaded the file and install Numpy using following command:
pip install numpy‑1.13.1+mkl‑cp34‑cp34m‑win32.whl
You should get successfully installed numpy message
Step 2) Install 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:
pip install scipy‑0.19.1‑cp34‑cp34m‑win32.whl
You should get this message successfully installed scipy
Step 3) Install 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:
pip install gensim‑2.3.0‑cp34‑cp34m‑win32.whl
You should get this message successfully installed gensim
Now in a Python shell try:
import gensim
It should be successfully imported
NOTES:
Make sure pip is in your environment variables (add C:\python34\scripts to your environment variable).
Make sure to download all the packages according to the Python version you are using.

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
pip install -U gensim
Or download gensim for windows from
https://pypi.python.org/pypi/gensim
then run
python setup.py test
python setup.py install

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:
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.
See: https://anaconda.org/anaconda/gensim

I strongly suggest using anaconda where the installation of all the packages is very easy.
The command for installing genism and all of its necessary packages on windows using anaconda python 3.7 is below.
conda install -c anaconda gensim

I followed the instruction on https://radimrehurek.com/gensim/install.html which then successfully installed the fast version of Gensim (3.8.0) on Windows:
conda install -c conda-forge gensim
PS:
The following did NOT install the fast version on Windows:
conda install gensim

After attempting some of the above ideas, there was still a "hiccup" with gensim but the error was something else related to punkt. The following (where the interest is the second line)...
import nltk
nltk.download('punkt')
import numpy
import scipy
import gensim
...did the trick. I used conda and not pip but do not believe that mattered.
Versions: latest python
Machine: Windows 10 (latest updates as of 8/2020)

Related

python library install Questions

I use Python and pycharm as a tool.
If you use the pip statement to install the library, you will get an error.
For example, if I want to download the torch (1.6.0) version and type pip install torch==1.6.0,
It says no version.
This is not the end, but some libraries continue to cause strange conflicts and will not be installed.
For example, if you type pip install poro to install the poro library, an unknown error pops up and the installation fails.
I'm not asking for a pororo installation.
My question is, I want to know how to download the library without relying on pycharm.
I want to download it separately from a site like pypi and put the library directly into the virtual environment (conda).
What should I do?
The following worked for me:
First, install mkl using conda:
conda install -c anaconda mkl
Then run this:
conda install -c pytorch pytorch

I installed TensorFlow and found no modules found

I downloaded it by pip install tensorflow in cmd
The installation is fine and I have tensorflow when I pip list and look at the list.
in Python,
import tensorflow
but can't find the module.
I can't install it with pip3.
What should I do?
I think you have multiple python versions installed.You can use cmd
'where python' on windows to find which python you are running and also verify where you have install tenserflow module using pip.

Anaconda installation of Tensorflow fails with Debian 8 VirtualBox

I'm trying to install Tensorflow.
I created a fresh Debian 8 VirtualBox for this purpose. Following the instructions here I downloaded and installed Anaconda with Python 3.
I created a conda environment for Tensorflow and activated it.
When trying to pip install Tensorflow it fails:
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
The error is
not a supported wheel on this platform
I found a similar thread where a person had this problem with Python 2.7 and VMware, but their solution didn't work for me (and also not for another person who commented that they were using VirtualBox).
I also tried specifying pip3 and pip3.5 rather than just pip.
This appears to be a "known" issue from the following issue. Which paraphrased you should be able to download https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl and change the name of the .whl to tensorflow-0.8.0-py3-none-linux_x86_64.whl and install it correctly. There has been a change to the github documentation for Tensorflow to set the python version to 3.4 instead of 3.5. However, it appears this change hasn't made it to Tensorflow.org's documentation
# Python 3.4
$ conda create -n tensorflow python=3.4

Problems installing TensorFlow on Mac

I am trying to follow to the installation guide on tensorflow.org and have installed Python version 2 again for that reason using Homebrew.
When I run the installation as described
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
I get this error message:
tensorflow-0.5.0-py2-none-any.whl is not a supported wheel on this platform.
I am obviously doing something wrong, but have no idea. Any clues?
I do not want to use virtualenv, since anaconda already comes with its own environment management conda. When installing the newest version 0.6.0 directly with pip install, I had a similar error. It seemed to not resolve the dependencies correctly.
Here is what you can try:
Install anaconda
Create a new conda workspace
Download the specific protobuf version that tensorflow needs: https://pypi.python.org/pypi/protobuf/3.0.0a3
Install it via sudo easy_install ~/Downloads/protobuf-3.0.0a3-py2.7.egg
Install a numpy version greater than 1.08.x via conda install numpy
Download the 0.6.0 version of tensorflow: https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
Install via pip install ~/Downloads/tensorflow-0.6.0-py2-none-any.whl
When you install tensorflow from the whl file directly, it should tell you when dependencies are not there. It seems not to be able to resolve these conflicts independently. My setup had issues with protobuf and numpy. After installing them manually everything worked fine.
I hope this helps!
It seems to be a common issue. Try to install it in the virtualenv. Its a much better solution, as you can always easily set up a new version of tensorflow without conflicts.
VirutalEnv Tutorial:
http://tensorflow.org/get_started/os_setup.md#virtualenv-based_installation
On the Mac, I didn't have any problem installing tensorflow with the anaconda version of python: https://www.continuum.io/downloads
The anaconda version also provides science, math, engineering, and data analysis packages. A lot of people on https://www.kaggle.com/ seem to use this...just a thought.

Error installing from GitHub using pip on Windows

I am on a Windows machine and I want to install a Python module from GitHub using pip directly from IPython.
The simplest command that seems it should work is:
!pip install https://github.com/japerk/nltk-trainer.git
I have also tried:
!pip install https://github.com/japerk/nltk-trainer.git#egg=nltk-trainer
I've used variants including -vvv, etc.
However, I'm getting the following error. Why?
Cannot determine archive format of C:\Users\timo\AppData\Local\Temp\pip-build-183bwemw\nltk-trainer
go to the https://github.com/japerk/nltk-trainer and download the project zip file. extract the zip file and put it somewhere in your computer.
open command prompt in windows and go inside the folder that you extracted earlier(you must be in the folder that has setup.py file in it).
enter the following command: python setup.py install
python tries to install nltk-trainer . during installation some other dependency might be installed too. you need numpy and scipy to be installed. if any problem happened during installation of numpy or scipy try installing them manually first by using pip install numpy and pip install scipy
if you can't install numpy and scipy using pip command use the following link:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
this site has compiled version of these libraries ( and other libraries if you need to install them too) you can download .whl file that is based on your python version and os architecture and install them using pip install filename.whl command ( you need to be in the folder that your whl file is) for example for python3.4 and 64bit operating system you may download scipy‑0.16.0‑cp34‑none‑win_amd64.whl file.

Categories

Resources