Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training. #2572

Closed
infokiftikhar opened this issue Aug 9, 2019 · 21 comments
Labels
need info Not enough information for reproduce an issue, need more info from author

Comments

@infokiftikhar
Copy link

How to solve this User Warning Error in Windows 10. I am running code with Command Prompt and writing it in Notepad++.

C extension not loaded, training will be slow. Install a C compiler and reinstall gensim for fast training.

Kindly write such commands that can be executed in cmd.

@piskvorky
Copy link
Owner

piskvorky commented Aug 9, 2019

Missing information -- we'll have to close this issue unless you fill in the issue template fully.

@piskvorky piskvorky added the need info Not enough information for reproduce an issue, need more info from author label Aug 9, 2019
@guo18306671737
Copy link

hi, have you solved this problem? I had the same problem ,thanks!

@guo18306671737
Copy link

@piskvorky in 2015,the solution to "C extension not loaded, training will be slow" was to use version 0.15 of scipy,but the python I'm using now is 3.7,and version 0.15 of scipy can no longer be used on python 3.7.How can I solve this problem now? Please give me some advice. Thanks

image

image

@piskvorky
Copy link
Owner

Issue template not followed, information still missing.

@guo18306671737 how did you install gensim? Did the installation process print any warnings or errors?

@guo18306671737
Copy link

@piskvorky thank you very much for your reply! I looked at #351 and #2508, I install genism by 'pip install gensim-3.8.0-cp37-cp37m-win_amd64.whl',and the installation procession was successful . I installed C++,but it didn't seem to work.
image
image

@piskvorky
Copy link
Owner

piskvorky commented Aug 18, 2019

Thanks, that helps. So you installed gensim 3.8 with pip on Windows, but you're seeing a warning when you try to train word2vec.

Can you provide the rest of the information:

import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import gensim; print("gensim", gensim.__version__)
from gensim.models import word2vec;print("FAST_VERSION", word2vec.FAST_VERSION)

@guo18306671737
Copy link

image

hi, this is my latest version of the information, and now it doesn't work. The previous version of scipy was 1.3.1,and it didn't work. I also tried genism-cp36 and genism-cp38, Neither of them worked.

@piskvorky
Copy link
Owner

Thanks. @mpenkov @gojomo any idea why the compiled version would be failing like this?

@gojomo
Copy link
Collaborator

gojomo commented Aug 18, 2019

There was probably an error during pip-installation's attempt to build the DLL. But I'm just guessing; it's been almost a decade since I used Windows for any development. I suspect the default tools on Windows can't build everything on demand, using the default configs/sources, as easily as on the Unix/Linux-y distributions.

For people who can't switch away from Windows, I think conda-based installations usually work, by pulling the right precompiled stuff from Windows-specific conda repositories

@piskvorky
Copy link
Owner

I don't think anything's being built on demand. We're distributing binary wheels.

@guo18306671737
Copy link

image

@gojomo Do you mean that conda installs genism like this ,and it still doesn't work.

@gojomo
Copy link
Collaborator

gojomo commented Aug 19, 2019

@piskvorky I thought Windows-wheels were a separate option a user had to choose somehow, and that a default pip install gensim still tried to build from sources. If pip install gensim is supposed to already install pre-compiled working wheels, then yes, that would appear to be broken and the expert on Windows-wheels should look into this report!

@gojomo
Copy link
Collaborator

gojomo commented Aug 19, 2019

@guo18306671737 Not sure what you mean by "still doesn't work". Is that all the output of the command? What code is then run and generates what message? (It's be helpful to show it all, and ideally as quoted text rather than screenshots.)

@piskvorky
Copy link
Owner

piskvorky commented Aug 19, 2019

pip install gensim should install from a binary wheel, where available. AFAIK we automatically build (and upload to PyPI) lots of wheels, for all combinations of {Linux, OSX, Windows} x {2.7, 3.5, 3.6, 3.7}. @mpenkov can you confirm?

So @guo18306671737 's Win x 3.7 should be covered too. It's weird that there's no error, yet it still fails.

@gojomo
Copy link
Collaborator

gojomo commented Aug 19, 2019

@guo18306671737's "C extension not loaded" error message seems to come from an Anaconda-derived path. But the shown "successful" install is just a pip install [PATH_TO_LOCAL_WHL] – which might not be installing to the same environment as the error comes from. if using an Anaconda environment, using a conda-driven install may be clearer in its effects (even though pip might be expected to work if the conda-env is properly activated.)

@guo18306671737
Copy link

@gojomo @piskvorky It's amazing. I managed to install genism again through conda in anaconda, and I'm not sure which step worked, thanks very much!

@mpenkov
Copy link
Collaborator

mpenkov commented Sep 7, 2019

Sounds like problem was solved, closing.

@mpenkov mpenkov closed this as completed Sep 7, 2019
@alex-arkhipov
Copy link

Hello,
I have the same problem with my windows machine. I have also reinstalled gensim via "conda" and this message disappeared. However, I have found that conda installed gensim 3.4.0 which is way to old. Is thare any way to install genism 3.8.0 with C compiler enabled (via pip or conda - doesn't matter)?

@mpenkov
Copy link
Collaborator

mpenkov commented Sep 9, 2019

@alex-arkhipov I think your problem is related to #2600

That's an entirely different issue.

@gmnabeel
Copy link

@gojomo @piskvorky It's amazing. I managed to install genism again through conda in anaconda, and I'm not sure which step worked, thanks very much!

Can u help me out? Same issue

@piskvorky
Copy link
Owner

piskvorky commented Jan 17, 2020

Open a new Github ticket, and fill it in fully: your Python version, operating system version, version of Gensim you're installing, etc. Then we can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Not enough information for reproduce an issue, need more info from author
Projects
None yet
Development

No branches or pull requests

7 participants