Defozo
Defozo

Reputation: 3092

How to install Polyglot on Windows?

When trying to run my server in python I got the following error:

D:\WebServ 2\httpd>python server.py Traceback (most recent call last): File "server.py", line 7, in from word2vec import transform_text, getKthNeighbour, closest_k_points_tsne File "D:\WebServ 2\httpd\word2vec.py", line 7, in import polyglot ImportError: No module named polyglot

How to solve this problem?

Upvotes: 0

Views: 1144

Answers (1)

user6110561
user6110561

Reputation:

I don't know your folders hieracy but it seems that server.py can't find your module. If you open server.py with the IDLE and go to >files>path browser, you should see anything like this:

--------------------------------------_OX
|/¬                                      |
| |-root/currentworkingdirectory         |
| |-usr/lib/python                       |
| |-usr/lib/python3.3                    |
| |-usr/lib/python/tkinter               |
|                                        |
------------------------------------------

If the module is not in any of these folders, you will have to move it to there. If the code of your module is in a subfolder of one of these, import it like this:

from subfolder.subsubfolder.polyglot import *

Then you have to set 'polyglot.' before all functoins, classes etc when you use a funcion, class, etc in server.py. I hope that's it, my programs work all like this.

Upvotes: 1

Related Questions