rlvaugh / Real_World_Python

Code and supporting files for book Real World Python
169 stars 117 forks source link

Getting gensim module #3

Closed dougler closed 3 years ago

dougler commented 3 years ago

I have tried to pip install and pychram get the gensim module. I get about 5 pages of errors in red? Ditto with wordcloud. Any advice?

rlvaugh commented 3 years ago

What operating system are you using? Lee Vaughan

On Saturday, January 16, 2021, 02:26:13 PM CST, dougler <notifications@github.com> wrote:  

I have tried to pip install and pychram get the gensim module. I get about 5 pages of errors in red? Ditto with wordcloud. Any advice?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dougler commented 3 years ago

I am using Windows 10 Have had no problems with pyCharm module loading until the gensim and wordcloud Chapt 4.

rlvaugh commented 3 years ago

I don't know what your errors are, but gensim requires numpy and scipy, two modules you should have installed already since you did Chapter 1. It is possible for the numpy version to be different from what gensim was compiled against, causing problems. Here's something from gensim support:

This issue is all about having two versions of other packages and stuffs in python installation folder. So, gensim package is getting confused while referring to other needful packages.

Solution to this problem : Create a virtual environment of python in your own system. (Like, you can run some projects with your base installation of python, While this virtual environment can be used for running other projects.(In my case, I am going to run all the projects which needs gensim package in virtual environment.)

How to create virtual environment in your system? http://docs.python-guide.org/en/latest/dev/virtualenvs/

Follow this link and create a virtual environment of python.

How to switch between two different python environments?

To work on virtual environment: $ source venv/bin/activate

$ deactivate To work on base version of python.

dougler commented 3 years ago

Im using windows 10 Have not had problems with module until gensim and wordcloud see attached and thanks

On Sat, Jan 16, 2021 at 1:00 PM rlvaugh notifications@github.com wrote:

What operating system are you using? Lee Vaughan

On Saturday, January 16, 2021, 02:26:13 PM CST, dougler < notifications@github.com> wrote:

I have tried to pip install and pychram get the gensim module. I get about 5 pages of errors in red? Ditto with wordcloud. Any advice?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rlvaugh/Real_World_Python/issues/3#issuecomment-761652595, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANARLRKELIL5H67EW76KI43S2H46JANCNFSM4WFQ2DRQ .

-- Regards, Doug Brown

rlvaugh commented 3 years ago

Another suggestion is using pip to uninstall scipy, numpy, gensim, then reinstalling them IN THAT ORDER. The best bet for you will probably be to take some of the error codes you are getting and search for them on Google. Also, be sure you included the "-U" in the install: pip install -U gensim

dougler commented 3 years ago

with pycharm I setup a virtual environment for Natural Language. numpy v. 4 never worked so I had been using v3 the numpy i installed with this project is v.5 which seems to work fine - tried v.3 which did not help with the gensim module

On Sat, Jan 16, 2021 at 1:25 PM rlvaugh notifications@github.com wrote:

I don't know what your errors are, but gensim requires numpy and scipy, two modules you should have installed already since you did Chapter 1. It is possible for the numpy version to be different from what numpy was compiled against, causing problems. Here's something from gensim support:

This issue is all about having two versions of other packages and stuffs in python installation folder. So, gensim package is getting confused while referring to other needful packages.

Solution to this problem : Create a virtual environment of python in your own system. (Like, you can run some projects with your base installation of python, While this virtual environment can be used for running other projects.(In my case, I am going to run all the projects which needs gensim package in virtual environment.)

How to create virtual environment in your system? http://docs.python-guide.org/en/latest/dev/virtualenvs/

Follow this link and create a virtual environment of python.

How to switch between two different python environments?

To work on virtual environment: $ source venv/bin/activate

$ deactivate To work on base version of python.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/rlvaugh/Real_World_Python/issues/3#issuecomment-761670506, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANARLRIEIFNJMNJMNMDKQ7LS2H745ANCNFSM4WFQ2DRQ .

-- Regards, Doug Brown

rlvaugh commented 3 years ago

Here is a commonly-reported fix for Windows users who have trouble installing wordcloud:

py -3.9 -m pip install wordcloud-1.8.1-cp39-cp39-win_amd64.whl commented Dec 10, 2020 by Vibha B S try this it will work

py -3.9 -m pip install wordcloud-1.8.1-cp39-cp39-win_amd64.whl

here -3.9 is your python version

this is your wordcloud file which u have to download seperatly -> wordcloud-1.8.1-cp39-cp39-win_amd64.whl

link for download-> https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud