spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

pip install spaCy fails on Mac OS 10.13.1

Open RobinAllenson opened this issue 8 years ago • 4 comments

I followed the instructions on https://spacy.io/usage/ to install spaCy 2.0 with pip. I used a virtualenv, i.e.

mkdir spaCy2 cd spaCy2 virtualenv .env source .env/bin/activate pip install spaCy

that appears to work, but on running spaCy, e.g. to download a language model, I got a lot of errors:

(.env) ra% python -m spacy info --markdown Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 151, in _run_module_as_main mod_name, loader, code, fname = _get_module_details(mod_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 109, in _get_module_details return _get_module_details(pkg_main_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 101, in _get_module_details loader = get_loader(mod_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 464, in get_loader return find_loader(fullname) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 474, in find_loader for importer in iter_importers(fullname): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 430, in iter_importers __import__(pkg) File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/spacy/__init__.py", line 4, in from .cli.info import info as cli_info File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/spacy/cli/__init__.py", line 1, in from .download import download File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/spacy/cli/download.py", line 10, in from .link import link File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/spacy/cli/link.py", line 8, in from ..util import prints File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/spacy/util.py", line 8, in import regex as re File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/regex.py", line 672, in _pattern_type = type(_compile("", 0, {})) File "/Users/robin/Code/spaCy2/.env/lib/python2.7/site-packages/regex.py", line 425, in _compile pattern_locale = _getlocale()[1] File "/Users/robin/Code/spaCy2/.env/lib/python2.7/locale.py", line 562, in getlocale return _parse_localename(localename) File "/Users/robin/Code/spaCy2/.env/lib/python2.7/locale.py", line 475, in _parse_localename raise ValueError, 'unknown locale: %s' % localename ValueError: unknown locale: UTF-8

and

Your Environment

  • Operating System: Mac OS 10.13.1
  • Python Version Used: 2.7.10
  • spaCy Version Used: 2.0
  • Environment Information: a fresh install using virtualenv.

I tried to install using source files (in a new virtualenv with the same environment as above), but this didn't work either. This time it complained about a deprecated NumPy version. That looks like an old solved issue from last year, but that issue was no help to me in resolving this.

RobinAllenson avatar Dec 29 '17 00:12 RobinAllenson

@RobinAllenson have you tried setting export LC_ALL=en_US.UTF-8 in your terminal session?

fucking-signup avatar Dec 29 '17 01:12 fucking-signup

@fucking-signup thank you so much! That fixed it.

RobinAllenson avatar Dec 31 '17 14:12 RobinAllenson

@RobinAllenson glad it helped!

However, this is a temporary solution as it sets the environment variable only for the current session. To make it permanent you have to add this line to your .bash_profile.

fucking-signup avatar Dec 31 '17 19:12 fucking-signup

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 08 '18 04:05 lock[bot]