aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.3k stars 337 forks source link

Pip install issue on OsX with python 2.7.8 #134

Open macarthy opened 6 years ago

macarthy commented 6 years ago

First, thanks for your hard work creating this software.

Have an issue installing on OSX ( I wish OsX did a better job with ICU )

± pip install polyglot Collecting polyglot /Users/macarthy/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject 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/security.html#snimissingwarning. SNIMissingWarning /Users/macarthy/.pyenv/versions/2.7.8/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:122: 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/security.html#insecureplatformwarning. InsecurePlatformWarning Downloading polyglot-16.7.4.tar.gz (126kB) 100% |████████████████████████████████| 133kB 650kB/s Requirement already satisfied: futures>=2.1.6 in /Users/macarthy/.pyenv/versions/2.7.8/lib/python2.7/site-packages (from polyglot) Collecting PyICU>=1.8 (from polyglot) Downloading PyICU-1.9.8.tar.gz (183kB) 100% |████████████████████████████████| 184kB 1.1MB/s Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/3l/bnbtkwsj23ncm0scfm1dwbwh0000gn/T/pip-build-62PCfi/PyICU/setup.py", line 33, in ''') RuntimeError: Please set the ICU_VERSION environment variable to the version of ICU you have installed.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/3l/bnbtkwsj23ncm0scfm1dwbwh0000gn/T/pip-build-62PCfi/PyICU/

Python version is ± python --version Python 2.7.8

OsX version 10.11.6

macarthy commented 6 years ago

Anwsering my own issue, perhaps the Docs should have OSX instructions ?

I just got PyICU to install on OSX, after it was failing due to that same error. Here is what I recommend:

Install homebrew (package manager for OSX)

brew install icu4c # Install the library; may be already installed

Verify that the necessary include directory is present: ls -l /usr/local/opt/icu4c/include/If you do not have that directory, you may need to reinstall icu4u. I found that I had to do the following:

brew remove icu4c

brew install icu4c

Try to install polyglot to see if it can find icu4c:  pip install polyglot

If that still complains, you can try specifying library location: CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib pip install polyglot

-- | --

sebastian-palma commented 6 years ago
$ brew install icu4c
$ brew link icu4c --force

Might help.