-2

I just got an error on installing pyfasttext.

cogent@MBP: pip install --user pyfasttext          

And then I got these:

Collecting pyfasttext Downloading https://files.pythonhosted.org/packages/f5/ef/90606442481d1e4ab10eba8c2b2c449ceaa70c60e9b8d5898bb7504e3634/pyfasttext-0.4.6.tar.gz (244kB) 100% |████████████████████████████████| 245kB 224kB/s Requirement already satisfied: future in /Users/cogent/Library/Python/2.7/lib/python/site-packages (from pyfasttext) (0.18.1) Requirement already satisfied: cysignals in /Users/cogent/Library/Python/2.7/lib/python/site-packages (from pyfasttext) (1.10.2) Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pyfasttext) (1.8.0rc1) Requirement already satisfied: Cython>=0.28 in /Library/Python/2.7/site-packages (from cysignals->pyfasttext) (0.29.13) Installing collected packages: pyfasttext Running setup.py install for pyfasttext ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-record-Qtcina/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_ext building 'pyfasttext' extension creating build creating build/temp.macosx-10.14-intel-2.7 creating build/temp.macosx-10.14-intel-2.7/src creating build/temp.macosx-10.14-intel-2.7/src/fastText creating build/temp.macosx-10.14-intel-2.7/src/fastText/src cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -iquote . -include src/custom_exit.h -arch i386 -arch x86_64 -pipe -Isrc -I/Users/cogent/Library/Python/2.7/lib/python/site-packages/cysignals -I. -Isrc/variant/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c src/pyfasttext.cpp -o build/temp.macosx-10.14-intel-2.7/src/pyfasttext.o -Wno-sign-compare -std=c++0x In file included from src/pyfasttext.cpp:53: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register const wchar_t w, / wchar_t buffer */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register wchar_t w, / wchar_t buffer */ ^~~~~~~~~ In file included from src/pyfasttext.cpp:53: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:94: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / string or Unicode object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register char **s, /* pointer to buffer variable */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register Py_ssize_t len / pointer to length variable or NULL ^~~~~~~~~ In file included from src/pyfasttext.cpp:676: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:4: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:17: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarraytypes.h:1760: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "Using deprecated NumPy API, disable it by " \ ^ 8 warnings generated. In file included from src/pyfasttext.cpp:53: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:534:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:553:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj / Object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:575:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register const wchar_t w, / wchar_t buffer */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:593:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register wchar_t w, / wchar_t buffer */ ^~~~~~~~~ In file included from src/pyfasttext.cpp:53: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:94: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register PyObject obj, / string or Unicode object */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register char **s, /* pointer to buffer variable */ ^~~~~~~~~ /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] register Py_ssize_t len / pointer to length variable or NULL ^~~~~~~~~ In file included from src/pyfasttext.cpp:676: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/arrayobject.h:4: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarrayobject.h:17: In file included from /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/ndarraytypes.h:1760: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings] #warning "Using deprecated NumPy API, disable it by " \ ^ 8 warnings generated. cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -iquote . -include src/custom_exit.h -arch i386 -arch x86_64 -pipe -Isrc -I/Users/cogent/Library/Python/2.7/lib/python/site-packages/cysignals -I. -Isrc/variant/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -c src/fasttext_access.cpp -o build/temp.macosx-10.14-intel-2.7/src/fasttext_access.o -Wno-sign-compare -std=c++0x src/fasttext_access.cpp:43:1: error: non-type template argument is not a pointer to member constant ALLOW_METHOD_ACCESS(FastText, bool, checkModel, std::istream&); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:55:38: note: expanded from macro 'ALLOW_METHOD_ACCESS' template struct rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:54:1: error: non-type template argument is not a pointer to member constant ALLOW_CONST_METHOD_ACCESS(Dictionary, int32_t, find, const std::string&); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:59:38: note: expanded from macro 'ALLOW_CONST_METHOD_ACCESS' template struct rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:55:1: error: non-type template argument is not a pointer to member constant ALLOW_CONST_METHOD_ACCESS(Dictionary, void, pushHash, std::vector&, int32_t); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:59:38: note: expanded from macro 'ALLOW_CONST_METHOD_ACCESS' template struct rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:56:1: error: non-type template argument is not a pointer to member constant ALLOW_METHOD_ACCESS(Dictionary, void, initTableDiscard, ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:55:38: note: expanded from macro 'ALLOW_METHOD_ACCESS' template struct rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/fasttext_access.cpp:57:1: error: non-type template argument is not a pointer to member constant ALLOW_METHOD_ACCESS(Dictionary, void, initNgrams, ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/private_access.h:55:38: note: expanded from macro 'ALLOW_METHOD_ACCESS' template struct rob ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 errors generated. error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-record-Qtcina/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/gm/kpbf6gyx1dx_167zbp2gmdym0000gn/T/pip-install-wuuXwu/pyfasttext/

Why I got these message? Any idea? Thanks for much!

1 Answers1

1

Accourding to this answer, PyFastText is no longer maintained.

You can instead use:

pip install fastText
Chokoladekiks
  • 666
  • 1
  • 5
  • 18
  • Thanks,I has tried fasttext version, it works. But the project was based on pyfasttext, I have to run up with it, and try to find out the root cause from some history issue which puzzled us for a long time. So you know how why it failed on setting up? thanks again~ – Shuyi Cui Oct 26 '19 at 01:42