ModuleNotFoundError: No module named 'gensim'

Ads
 

ModuleNotFoundError: No module named 'gensim'

Hi,

I am working on a project which involves machine learning and natural language processing. I have to use gensim in a program.

When executed my program gives following error:

ModuleNotFoundError: No module named 'gensim'

Full error details are:

Traceback (most recent call last):
  File "1.py", line 20, in <module>
    import gensim
ModuleNotFoundError: No module named 'gensim'

How to install gensim to remove error?

Thanks

View Answers

January 19, 2019 at 8:16 AM

Hi,

You can install gensim with following command:

pip install gensim

Thanks


January 19, 2019 at 8:17 AM

Hi,

I have installed it with pip install gensim command and here is full output:

(tf12) [email protected]:~/textgeneration$ pip install gensim
Collecting gensim
  Downloading https://files.pythonhosted.org/packages/a0/8e/719275cb952330a14752655141ceda5f6ec4c065eb3f54993943f89faa4e/gensim-3.7.0-cp36-cp36m-manylinux1_x86_64.whl (24.2MB)
    100% | | 24.2MB 628kB/s 
Collecting smart-open>=1.7.0 (from gensim)
  Downloading https://files.pythonhosted.org/packages/ff/c8/de7dcf34d4b5f2ae94fe1055e0d6418fb97a63c9dc3428edd264704983a2/smart_open-1.8.0.tar.gz (40kB)
    100% | | 40kB 863kB/s 
Requirement already satisfied: six>=1.5.0 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from gensim) (1.12.0)
Requirement already satisfied: numpy>=1.11.3 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from gensim) (1.16.0)
Requirement already satisfied: scipy>=0.18.1 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from gensim) (1.2.0)
Collecting boto>=2.32 (from smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/23/10/c0b78c27298029e4454a472a1919bde20cb182dab1662cec7f2ca1dcc523/boto-2.49.0-py2.py3-none-any.whl (1.4MB)
    100% | | 1.4MB 812kB/s 
Collecting bz2file (from smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/61/39/122222b5e85cd41c391b68a99ee296584b2a2d1d233e7ee32b4532384f2d/bz2file-0.98.tar.gz
Collecting requests (from smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
    100% | | 61kB 1.2MB/s 
Collecting boto3 (from smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/4b/93/9c00e96d877bccccf988d4244c56261aef536682d3ad1ee38db5ae742d3e/boto3-1.9.82-py2.py3-none-any.whl (128kB)
    100% | | 133kB 1.2MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% | | 143kB 1.4MB/s 
Collecting idna<2.9,>=2.5 (from requests->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% | | 61kB 1.2MB/s 
Requirement already satisfied: certifi>=2017.4.17 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from requests->smart-open>=1.7.0->gensim) (2018.11.29)
Collecting urllib3<1.25,>=1.21.1 (from requests->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
    100% | | 122kB 1.4MB/s 
Collecting botocore<1.13.0,>=1.12.82 (from boto3->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/ee/3a/2c1ef0f7d9f13db88a3b1475bfc0eafacfd9e5a622ecf8fb34ffb0c33fe3/botocore-1.12.82-py2.py3-none-any.whl (5.2MB)
    100% | | 5.2MB 1.2MB/s 
Collecting s3transfer<0.2.0,>=0.1.10 (from boto3->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/d7/14/2a0004d487464d120c9fb85313a75cd3d71a7506955be458eebfe19a6b1d/s3transfer-0.1.13-py2.py3-none-any.whl (59kB)
    100% | | 61kB 1.2MB/s 
Collecting jmespath<1.0.0,>=0.7.1 (from boto3->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting python-dateutil<3.0.0,>=2.1; python_version >= "2.7" (from botocore<1.13.0,>=1.12.82->boto3->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
    100% | | 235kB 1.5MB/s 
Collecting docutils>=0.10 (from botocore<1.13.0,>=1.12.82->boto3->smart-open>=1.7.0->gensim)
  Downloading https://files.pythonhosted.org/packages/36/fa/08e9e6e0e3cbd1d362c3bbee8d01d0aedb2155c4ac112b19ef3cae8eed8d/docutils-0.14-py3-none-any.whl (543kB)
    100% | | 552kB 878kB/s 
Building wheels for collected packages: smart-open, bz2file
  Running setup.py bdist_wheel for smart-open ... done
  Stored in directory: /home/deepak/.cache/pip/wheels/f7/a6/ff/9ab5842c14e50e95a06a4675b0b4a689c9cab6064dac2b01d0
  Running setup.py bdist_wheel for bz2file ... done
  Stored in directory: /home/deepak/.cache/pip/wheels/81/75/d6/e1317bf09bf1af5a30befc2a007869fa6e1f516b8f7c591cb9
Successfully built smart-open bz2file
Installing collected packages: boto, bz2file, chardet, idna, urllib3, requests, python-dateutil, docutils, jmespath, botocore, s3transfer, boto3, smart-open, gensim
Successfully installed boto-2.49.0 boto3-1.9.82 botocore-1.12.82 bz2file-0.98 chardet-3.0.4 docutils-0.14 gensim-3.7.0 idna-2.8 jmespath-0.9.3 python-dateutil-2.7.5 requests-2.21.0 s3transfer-0.1.13 smart-open-1.8.0 urllib3-1.24.1
(tf12) [email protected]:~/textgeneration$

Thanks


January 19, 2019 at 8:19 AM

Hi,

The gensim is powerful open-source python library for vector space modeling and topic modeling.

This tool is used for topic modeling and text processing activities.

Thanks


January 19, 2019 at 8:21 AM

Hi,

Gensim is powerful machine learning and text processing library in Python and it comes with following machine learning implementations:

  • tf-idf
  • random projections
  • word2vec and document2vec algorithms
  • hierarchical Dirichlet processes (HDP)
  • latent semantic analysis (LSA, LSI, SVD)
  • latent Dirichlet allocation (LDA)

It also comes with distributed parallel versions for faster processing of data.

Thanks

Ads









Related Tutorials/Questions & Answers:
ImportError: No module named scipy.ndimage - Solved
ImportError: No module named scipy.ndimage - Solved  Hi, How to solve following error: ImportError: No module named scipy.ndimage This error..., in <module> import scipy.ndimage as ndi ImportError: No module named
Hibernate named queries
Hibernate named queries  Hi, What is named queries in Hibernate? Thanks
Advertisements
a class named Transactions
a class named Transactions  Write this java code for me: a class named Transactions that holds the memo and the amount of a transaction. Prompt the user for the number of transactions and create a new Transaction object
Design a class named account
Design a class named account  The class contains: § An int data field named id for the account (default 0). § A double data field named balance for the account (default 0.0) § A double data field named annualInterestRate
Database named studentinfo
Database named studentinfo  1.create design of studentinfo using swing component 2.Create a database named student info. 3.create a table that stores all the details from the form,application of basic Normalization is required
Database named studentinfo
Database named studentinfo  1.create design of studentinfo using swing component 2.Create a database named student info. 3.create a table that stores all the details from the form,application of basic Normalization is required
Database named studentinfo
Database named studentinfo  1.create design of studentinfo using swing component 2.Create a database named student info. 3.create a table that stores all the details from the form,application of basic Normalization is required
Named ? SQL query in hibernate
Named ? SQL query in hibernate  What is Named SQL query in hibernate?   You can put all the HQL into the XML mapping file rather than putting the sql queries to various places in between code. sample.hbm.xml <
Hibernate Named Query
This section contain description of named query with example
create named class - Java Beginners
create named class  Can you check my [email protected]: How to create a class named Employee with name and salary. Make a class Manager inherit from Employee with an instance field named department. Supply a method toString
Hibernate Named Native SQL Query
In this section, you will learn Named Native SQL Query in Hibernate
JPA setParameter (Named Parameter)
JPA setParameter (Named Parameter)   ... API's method setParameter as a named parameter. JPA Query API's supports two types of setParameter.  1. Named Parameters  2. Numbered Parameters
Hibernate Named HQL in Annotation
In this section, you will learn how to execute Named HQL written in Model class Annotation
Admin Module
Admin Module The admin have the privilege  to add the question, delete the question. He is responsible for maintaining the site. He can also search the question paper by question Id and by title. The Admin does the following
Version of com.fmpwizard>lift-named-comet_2.8.2 dependency
List of Version of com.fmpwizard>lift-named-comet_2.8.2 dependency
Version of com.fmpwizard>lift-named-comet_2.8.1 dependency
List of Version of com.fmpwizard>lift-named-comet_2.8.1 dependency
Version of com.fmpwizard>lift-named-comet_2.9.0-1 dependency
List of Version of com.fmpwizard>lift-named-comet_2.9.0-1 dependency
Version of com.fmpwizard>lift-named-comet_2.9.1 dependency
List of Version of com.fmpwizard>lift-named-comet_2.9.1 dependency
User Module
User Module The user first need to make registration on the website for appearing in the online examination. After the making successful registration he is eligible for online test examination. To appear in the examination he need
spring JEE module tutorial
spring JEE module tutorial  Hi, I want spring Jee module tutorial and spring ORM module tutorial plz send me
named parameters vs postional parameters - Hibernate
named parameters vs postional parameters  hi,Can you please explain why we i should go for particular parameters or positional parameter... regards, somasekhar
Hibernate Named HQL using XML Mapping
In this section, you will learn executing Named HQL written in XML Mapping file
JPA Named Parameter List
JPA Named Parameter List   ... application using JPA Named Parameter List. This is similar as named parameter but here we use the an array list as named parameter.  Named Parameter List
JPA Named Parameter
JPA Named Parameter       In this section, you will learn how to use JPA Named Parameter in your jpa application. In JPA named parameter is used where you assign names
Hibernate Named Native SQL in Annotation
In this section, you will learn how to execute the Named Native SQL written in Model class Annotation
JPA Named Queries
JPA Named Queries       In this section, you will know about the JPA Named Queries...;) }) For developing JPA Named Queries, you need the following files
spring DAO module turorial
spring DAO module turorial  how to integrate springDAO and spring webMVC
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined  Hi, In my web... is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
Write a program named InternetCharge_YourLastName that do the following:
Write a program named InternetCharge_YourLastName that do the following: ... per month unlimited access is provided. Write a program named InternetCharge.... Instruction: We should have two classes class named InternetService
Hibernate Named Query
Hibernate Named Query       Named Query is very useful concept in hibernate. It lets...;   Calling Named Query in the coding section You can call
Maven Dependency lift-named-comet_2.8.1 >> 0.3
You should include the dependency code given in this page to add Maven Dependency of com.fmpwizard >> lift-named-comet_2.8.1 version0.3 in your project

Ads