JasonKessler / scattertext

Beautiful visualizations of how language differs among document types.
Apache License 2.0
2.23k stars 289 forks source link

Installing scattertext on Windows #26

Closed limorigu closed 6 years ago

limorigu commented 6 years ago

Dear Jason and scattertext community,

I'm trying to install scattertext on my windows machine via pip for the past few hours and found it extremely frustrating. I installed most dependencies by downloading wheels from https://www.lfd.uci.edu/~gohlke/pythonlibs/, but one doesn't exist for scattertext.

I've been googling to exhaustion people with similar issues. Many times they suggest reinstalling visual studio and/or adding folders to PATH environment variable. I keep on running into new issues each time. (I keep on failing with fatal error C1083: Cannot open include file: 'io.h': No such file or directory when the installation tries to build wheels of cytoolz, thinc and spacy, even though I pre-installed them from wheels taken from the link above. If I fix the io.h issue by changing the include directory with the command line set, it then cannot include vcruntime.h, which lives in a different directory. Adding both of them to path doesn't resolve the issue.) It looks something like this:

`C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\l.gultchin\appdata\local\programs\python\python36-32\include -Ic:\users\l.gultchin\appdata\local\programs\python\python36-32\include /Tccytoolz/dicttoolz.c /Fobuild\temp.win32-3.6\Release\cytoolz/dicttoolz.obj
    dicttoolz.c
    c:\users\l.gultchin\appdata\local\programs\python\python36-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2

Command "c:\users\l.gultchin\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\L519E~1.GUL\\AppData\\Local\\Temp\\pip-build-uzgnn5ct\\cytoolz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\L519E~1.GUL\AppData\Local\Temp\pip-xx_x6kfv-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\L519E~1.GUL\AppData\Local\Temp\pip-build-uzgnn5ct\cytoolz\`

I also saw you comment on

this post, https://github.com/JasonKessler/scattertext/issues/15

and tried installing miniconda and going through that route, but unfortunately I couldn't locate the relevant file in conda-forge for some reason.

`(base) C:\Users\l.gultchin>conda config --add channels conda-forge

(base) C:\Users\l.gultchin>conda install scattertext
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - scattertext

Current channels:

  - https://conda.anaconda.org/conda-forge/win-32
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.continuum.io/pkgs/main/win-32
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/win-32
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/win-32
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/win-32
  - https://repo.continuum.io/pkgs/pro/noarch
  - https://repo.continuum.io/pkgs/msys2/win-32
  - https://repo.continuum.io/pkgs/msys2/noarch`

Has anyone dealt with this issue successfully and might have any insight?

Many thanks, Limor

JasonKessler commented 6 years ago

Hi Limor,

Sorry to hear about your problems installing the package.

I just removed a number of packages from the install requirements, and all you'll need is numpy, scipy, scikit-learn, and pandas. You'll need sPacy to run some of the example code, but you could always use a call to st.whitespace_nlp_with_sentences to use dumb regex tokenization and punctuation-based sentence segmentation.

Please try to run pip install scattertext again, and let me know if this works.

Jason

limorigu commented 6 years ago

Hi Jason,

Thanks so much for your helpful comment! In fact, I ended up using the package on a mac I found, on which it worked perfectly. I got too frustrated with spending so much time on installation on Windows.

Thanks again for taking the time to answer, and for developing this to begin with, you did an awesome job! Limor

JasonKessler commented 6 years ago

Great to hear!