Giter Site home page Giter Site logo

Comments (34)

rahul4tripathi2 avatar rahul4tripathi2 commented on July 27, 2024 16

How to install glove-python in windows

  1. git clone https://github.com/maciejkula/glove-python.git

  2. goto cloned directory location and open setup.py and remove 'stdc++' from libraries=[] paramerter after removing it will look like below

    Extension("glove.corpus_cython", [glove_corpus],
    language='C++',
    libraries=[],
    extra_link_args=compile_args,
    extra_compile_args=compile_args)]

  3. conda install cython

  4. open cmd from that location where setup.py is stored and run below command
    python setup.py install

  5. Verify
    glove

from glove-python.

huan086 avatar huan086 commented on July 27, 2024 6

I removed stdc++ from setup.py and it compiled and worked

        Extension("glove.corpus_cython", [glove_corpus],
                  language='C++',
                  libraries=[],
                  extra_link_args=compile_args,
                  extra_compile_args=compile_args)]

from glove-python.

prabhakar9885 avatar prabhakar9885 commented on July 27, 2024 4

I am able to install the Glove by following comment of @huan086

Now, I am getting an ImportError

from glove import Glove
importerror: No module named corpus_cython

Any idea how to fix it?

from glove-python.

maciejkula avatar maciejkula commented on July 27, 2024

Can you try to find out which file it thinks it's missing?

from glove-python.

chaltik avatar chaltik commented on July 27, 2024

Sorry, I am not sure where to look for something like that, I am fairly new
to Python, let alone to cython extensions. Seems like it happens shortly
after the line
building 'glove.glove_cython' extension
is printed, but i could not find anything similar to this line using grep.

On Sun, Jan 31, 2016 at 12:53 PM, maciejkula [email protected]
wrote:

Can you try to find out which file it think it's missing?


Reply to this email directly or view it on GitHub
#42 (comment)
.

from glove-python.

maciejkula avatar maciejkula commented on July 27, 2024

OK. I'll try to reproduce when I get a bit of time.

from glove-python.

chaltik avatar chaltik commented on July 27, 2024

Thanks so much! Will wait for your results.

On Mon, Feb 1, 2016 at 2:44 PM, maciejkula [email protected] wrote:

OK. I'll try to reproduce when I get a bit of time.


Reply to this email directly or view it on GitHub
#42 (comment)
.

from glove-python.

LopezGG avatar LopezGG commented on July 27, 2024

Is there a conda install for this ? I do have visual Studio 2015 with C++ installed. Here is the error I get

LINK : warning LNK4044: unrecognized option '/fopenmp'; ignored
LINK : warning LNK4044: unrecognized option '/ffast-math'; ignored
LINK : fatal error LNK1181: cannot open input file 'stdc++.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.exe' failed with exit status 1181

for python 3.5

from glove-python.

hank-nguyen avatar hank-nguyen commented on July 27, 2024

@LopezGG: I have the same issue. Have you found out how to fix it? Thank you very much.

from glove-python.

LopezGG avatar LopezGG commented on July 27, 2024

Nope. I did not figure it out. I used glove code compiled by a colleague. I suspect it has something to do with spaces in the path on windows OS

from glove-python.

hank-nguyen avatar hank-nguyen commented on July 27, 2024

@LopezGG : thank you. I also decided to use GloVe on Ubuntu instead.

from glove-python.

chaltik avatar chaltik commented on July 27, 2024

That's the direction I have taken as well

On Thu, Apr 28, 2016 at 5:44 AM, Suinga [email protected] wrote:

@LopezGG https://github.com/LopezGG : thank you. I also decided to use
GloVe on Ubuntu instead.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#42 (comment)

from glove-python.

elekesabel avatar elekesabel commented on July 27, 2024

same issue. is there any new solution for this?

from glove-python.

oshribr avatar oshribr commented on July 27, 2024

I removed stdc++ from setup.py and it compiled and worked

    Extension("glove.corpus_cython", [glove_corpus],
              language='C++',
              libraries=[],
              extra_link_args=compile_args,
              extra_compile_args=compile_args)]

Hi huam086,
After you remove 'stdc++' and is installed it, the package works fine ?

from glove-python.

Subinsm avatar Subinsm commented on July 27, 2024

Have you installed cython package. It is a prerequisite for installing glove-python.

from glove-python.

oshribr avatar oshribr commented on July 27, 2024

Have you installed cython package. It is a prerequisite for installing glove-python.

Hi Subinsm,

I'm using Anaconda, so yes I have Cython.

from glove-python.

Subinsm avatar Subinsm commented on July 27, 2024

Hi Subinsm,
I'm using Anaconda, so yes I have Cython.

Anaconda does not have cython pre-installed. You will have to install cython manually.
In a terminal try,
conda install cython
Have numpy to the latest version to avoid warning messages

from glove-python.

ConradSpiteri avatar ConradSpiteri commented on July 27, 2024

Thanks @huan086, It worked for me.

from glove-python.

JabeurSoufian avatar JabeurSoufian commented on July 27, 2024

thank you for the tutorial
How can I go to the clone directory(can you give the path)? to change setup.py configuration

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@huan086 @prabhakar9885 @rahul4tripathi2 @JabeurSoufian

Deleting the dependency may allow you to compile and install the package but it won't work as expected. The dependency is there for a reason.

After many hours of tinkering I've managed to install this package on Windows and the tests pass for me. I documented my findings in this wiki page:
https://github.com/maciejkula/glove-python/wiki/Installation-on-Windows

from glove-python.

sakurakhadag avatar sakurakhadag commented on July 27, 2024

Thanks a lot. It worked

@huan086 @prabhakar9885 @rahul4tripathi2 @JabeurSoufian

Deleting the dependency may allow you to compile and install the package but it won't work as expected. The dependency is there for a reason.

After many hours of tinkering I've managed to install this package on Windows and the tests pass for me. I documented my findings in this wiki page:
https://github.com/maciejkula/glove-python/wiki/Installation-on-Windows

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

I am having the same problems and when I try conda install cython I get this message

Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(507): An error occurred while installing package 'defaults::pyqt-4.10.4-py27_1'.
IOError(13, 'Permission denied')
Attempting to roll back.

Rolling back transaction: done

IOError(13, 'Permission denied')

And when I try to run setup install i get this too
Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@AHAMES do you have sufficient permissions to install new conda packages? Do you have other python programs running (including Jupyter Notebooks) that could prevent an old version of the pyqt library being replaced?

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

@IronFarm Spyder was running and after I closed it it installed, but I am still getting
Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
When running Setup install

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@AHAMES That's to be expected. Installing the package requires some C code to be compiled. One way of achieving this on Windows is to install Microsoft Visual C++ so I'd suggest installing the stated package.

I had most luck using an alternate compiler and python 3.6. I wrote up my installation procedure here:
https://github.com/maciejkula/glove-python/wiki/Installation-on-Windows

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

@IronFarm I followed your guide, but it still doesn't install, pytest is not recognized.
And I am getting this error while trying to import Glove.

Does you method work for python2.7 ?

>>> from glove import Glove
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "glove\__init__.py", line 1, in <module>
    from .corpus import Corpus
  File "glove\corpus.py", line 10, in <module>
    from .corpus_cython import construct_cooccurrence_matrix
ImportError: No module named corpus_cython

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@AHAMES well it's not too surprising that you can't import it if it didn't install. What is the installation error?

I haven't tried python 2.7 but it might work. I'd strongly recommend upgrading in the near future though as python 2 support has already been dropped by many major packages e.g. scipy & numpy.

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

I re-tracked my steps and found this when running pip install .

C:\Users\X\Documents\NetBeansProjects\MedHelpCrawler_1\glove-python>pip install .
Processing c:\users\ahmed\documents\netbeansprojects\medhelpcrawler_1\glove-python
Requirement already satisfied: numpy in c:\python27\lib\site-packages (from glove-python==0.1.0) (1.14.3)
Requirement already satisfied: scipy in c:\python27\lib\site-packages (from glove-python==0.1.0) (1.1.0)
Installing collected packages: glove-python
  Found existing installation: glove-python 0.1.0
    Uninstalling glove-python-0.1.0:
      Successfully uninstalled glove-python-0.1.0
  Running setup.py install for glove-python ... done
Successfully installed glove-python-0.1.0
c:\python27\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py:369: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py:160: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@AHAMES It suggests it successfully installed Glove before the error (the error suggests upgrading python FWIW).

Did you by any chance follow the steps in this comment? They allow the package to install but they completely break the package's functionality:
#42 (comment)

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

@IronFarm
I did actually follow them at first, you think it will work if i reverse it? Will try it.

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

@AHAMES You may have problems with the compilation and installation but when it installs it will actually work.

from glove-python.

AHAMES avatar AHAMES commented on July 27, 2024

@IronFarm
(I restarted from the beginning and got a python 3.6 virtual env, but for some reason it still runs on 2.7 when using pytest and it doesn't import when running python)
scratch that, it does import in python 3.6 when running python itself.
Thank you for your effort with me and thank you for your patience.

(glove) C:\Users\Ahmed\Documents\NetBeansProjects\glove-python>pytest
============================= test session starts =============================
platform win32 -- Python 2.7.15, pytest-3.8.0, py-1.6.0, pluggy-0.7.1
rootdir: C:\Users\Ahmed\Documents\NetBeansProjects\glove-python, inifile:
collected 0 items / 2 errors

=================================== ERRORS ====================================
____________________ ERROR collecting tests/test_corpus.py ____________________
ImportError while importing test module 'C:\Users\Ahmed\Documents\NetBeansProjects\glove-python\tests\test_corpus.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\Anaconda2\lib\site-packages\six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
tests\test_corpus.py:9: in <module>
    from glove import Corpus
E   ImportError: No module named glove
____________________ ERROR collecting tests/test_glove.py _____________________
ImportError while importing test module 'C:\Users\Ahmed\Documents\NetBeansProjects\glove-python\tests\test_glove.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
..\..\..\Anaconda2\lib\site-packages\six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
tests\test_glove.py:4: in <module>
    from glove import Corpus, Glove
E   ImportError: No module named glove
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 2 error in 0.41 seconds ===========================

from glove-python.

IronFarm avatar IronFarm commented on July 27, 2024

So is it working now? You probably need to install pytest in your python 3 virtual env for the tests to work. However, if the module is behaving as expected there is no need to run the tests.

from glove-python.

beiyaoovo avatar beiyaoovo commented on July 27, 2024

I removed stdc++ from setup.py and it compiled and worked

        Extension("glove.corpus_cython", [glove_corpus],
                  language='C++',
                  libraries=[],
                  extra_link_args=compile_args,
                  extra_compile_args=compile_args)]

You are my God! I spent a whole afternoon!

from glove-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.