Open chaltik opened 8 years ago
Can you try to find out which file it thinks it's missing?
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 notifications@github.com wrote:
Can you try to find out which file it think it's missing?
— Reply to this email directly or view it on GitHub https://github.com/maciejkula/glove-python/issues/42#issuecomment-177607712 .
OK. I'll try to reproduce when I get a bit of time.
Thanks so much! Will wait for your results.
On Mon, Feb 1, 2016 at 2:44 PM, maciejkula notifications@github.com wrote:
OK. I'll try to reproduce when I get a bit of time.
— Reply to this email directly or view it on GitHub https://github.com/maciejkula/glove-python/issues/42#issuecomment-178237359 .
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
@LopezGG: I have the same issue. Have you found out how to fix it? Thank you very much.
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
@LopezGG : thank you. I also decided to use GloVe on Ubuntu instead.
That's the direction I have taken as well
On Thu, Apr 28, 2016 at 5:44 AM, Suinga notifications@github.com 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 https://github.com/maciejkula/glove-python/issues/42#issuecomment-215411959
same issue. is there any new solution for this?
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)]
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 ?
Have you installed cython package. It is a prerequisite for installing glove-python.
Have you installed cython package. It is a prerequisite for installing glove-python.
Hi Subinsm,
I'm using Anaconda, so yes I have Cython.
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
Thanks @huan086, It worked for me.
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?
How to install glove-python in windows
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)]
thank you for the tutorial How can I go to the clone directory(can you give the path)? to change setup.py configuration
@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
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
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
@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?
@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
@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
@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
@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.
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
@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: https://github.com/maciejkula/glove-python/issues/42#issuecomment-325650191
@IronFarm I did actually follow them at first, you think it will work if i reverse it? Will try it.
@AHAMES You may have problems with the compilation and installation but when it installs it will actually work.
@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 ===========================
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.
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!
whether using python setup.py install or pip install glove-python commands from Anaconda prompt, any installation attempt ends in failure with the error 2 below