facebookresearch / fastText

Library for fast text representation and classification.
https://fasttext.cc/
MIT License
25.89k stars 4.71k forks source link

Install with Python error #386

Open nguyentheanhhnvntd opened 6 years ago

nguyentheanhhnvntd commented 6 years ago

I install using python3. (ver 3.6). After running: python3 setup.py install I receive error: clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) and later: src/fasttext.h:14:10: fatal error: 'atomic' file not found

include

     ^

(I'm using MacOS 10.12.6)

Note: I already have a python version of fasttext but when I put file model I train by newer version to fasttext python version and it return error: fastText: Cannot load model.bin due to C++ extension failed to allocate the memory

That's why I want to update my fasttext python version.

Can anyone give me a suggest. Thanks a lot.

cpuhrsch commented 6 years ago

Hello @nguyentheanhhnvntd,

Thank you for your post! I'll look into this as soon as I can.

Thanks, Christian

nguyentheanhhnvntd commented 6 years ago

Wish you can see it right now. Can you tell me the fasttext version of python install by "pip install fasttext"

cpuhrsch commented 6 years ago

Hello @nguyentheanhhnvntd,

Ah, it looks like you're using these Python bindings. These contain a very old version of fastText (a copy in fact) and I can currently not recommend using this. Furthermore, version 0.8.3. or older were not written by the authors of this library and we thus can't provide any support. To install the Python bindings that are part of this repository, please consult the README.

Thanks, Christian

nguyentheanhhnvntd commented 6 years ago

Yes, that's what I'm using, but as I show above, I received an error while installing with python. "python setup.py install" command: In file included from python/fastText/pybind/fasttext_pybind.cc:10: src/args.h:12:10: fatal error: 'istream' file not found

include

     ^~~~~~~~~

1 error generated. error: command '/usr/local/bin/clang' failed with exit status 1

cpuhrsch commented 6 years ago

Hello @nguyentheanhhnvntd,

Could you tell me a few more details about your environment? A quick google search showed up that you might need libstdc++. Are you using anaconda or such?

Thanks, Christian

nguyentheanhhnvntd commented 6 years ago

My gcc. If you need more about my environment, just tell me. I disabled python anaconda in .bath_profile. Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0

It error not . Beside, if I compile a c++ project in Xcode with "#import 'istream'" and It doesn't complain anything.

jchubber commented 6 years ago

I'm facing the same error building with python2.7 setup.py install as well.

Early on I see clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) and then later on:

In file included from python/fastText/pybind/fasttext_pybind.cc:11:
src/fasttext.h:14:10: fatal error: 'atomic' file not found
#include <atomic>
         ^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
ezyang commented 6 years ago

@jchubber Can you post the full build log (including the command you used to build the package). Most importantly, we want to know what flags the compiler is being called with. If you can also let us know if you're installing within a Conda environment, and if so, can you also post conda list and clang --version.

genbien commented 6 years ago

Hello, I'm seeing the same #include <atomic> error as @jchubber (albeit using python 3.6.3)

The build log:

fastText%(master|…) % python setup.py install
running install
running bdist_egg
running egg_info
writing python/fasttext.egg-info/PKG-INFO
writing dependency_links to python/fasttext.egg-info/dependency_links.txt
writing requirements to python/fasttext.egg-info/requires.txt
writing top-level names to python/fasttext.egg-info/top_level.txt
reading manifest file 'python/fasttext.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'python/fasttext.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.6-intel/egg
running install_lib
running build_py
copying python/fastText/FastText.py -> build/lib.macosx-10.6-intel-3.6/fastText
copying python/fastText/util/util.py -> build/lib.macosx-10.6-intel-3.6/fastText/util
copying python/fastText/util/__init__.py -> build/lib.macosx-10.6-intel-3.6/fastText/util
copying python/fastText/tests/test_script.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests
copying python/fastText/tests/__init__.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests
copying python/fastText/tests/test_configurations.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests
running build_ext
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmpugzl_d1u.cpp -o var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmpugzl_d1u.o -stdlib=libc++
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmpt1ht95pg.cpp -o var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmpt1ht95pg.o -std=c++14
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmp53ilybld.cpp -o var/folders/fs/mxp8mf193jz588z16bf0x6dh0000gn/T/tmp53ilybld.o -fvisibility=hidden
building 'fasttext_pybind' extension
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Users/genbien/Documents/Clevy/clevyenv/bin/../include/site/python3.6 -I/Users/genbien/Documents/Clevy/clevyenv/bin/../include/site/python3.6 -Isrc -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.6-intel-3.6/python/fastText/pybind/fasttext_pybind.o -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.6" -std=c++14 -fvisibility=hidden
In file included from python/fastText/pybind/fasttext_pybind.cc:11:
src/fasttext.h:14:10: fatal error: 'atomic' file not found
#include <atomic>
         ^~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1

Clang version:

fastText%(master|…) % clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
cpuhrsch commented 6 years ago

Hello @genbien,

Thank you for your comment. Could you try installing this using a different compiler via the CC flag?

For example

CC=g++ python setup.py install

Or using clang++, c++ as available and post the build log if it fails?

Thank you, Christian

genbien commented 6 years ago

@cpuhrsch The compiler flag didn't help but I think I figured it out! :smile: (see pr #398)

cpuhrsch commented 6 years ago

Hello @genbien,

Thank you very much for looking into this and helping us make our Python bindings more accessible! I'm happy this fix works for you and I hope it'll also resolve this for the other users here. There was also https://github.com/facebookresearch/fastText/pull/375, which appears necessary for OS X compilers other than clang, so we'll need to extend setup.py a bit more to also incorporate this. I've also still not been able to reproduce this on my end, so a more detailed investigation will be necessary to make this won't break anything for other platforms. We'll have a more "wholesome" setup out soon.

Thank you, Christian

cpuhrsch commented 6 years ago

Hello @genbien,

I pushed your fix together with the other required features. Could I kindly ask you try installing our Python bindings again with this new code?

Thank you, Christian

genbien commented 6 years ago

@cpuhrsch I just tested the new installation and it works great, thanks for the fix! 👍

cpuhrsch commented 6 years ago

Hello @nguyentheanhhnvntd, @jchubber,

Could you try installing fastText again using the latest version?

Thanks, Christian

nguyentheanhhnvntd commented 6 years ago

MacBook-Pro-cua-The:fastText-master theanhnguyen$ pip3 install . Processing /Users/theanhnguyen/Downloads/fastText-master Requirement already satisfied: pybind11>=2.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Requirement already satisfied: setuptools>=0.7.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Building wheels for collected packages: fasttext Running setup.py bdist_wheel for fasttext ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-qo8xyccl-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpk_zhju1hpip-wheel- --python-tag cp36: running bdist_wheel running build running build_py running build_ext /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpfktpeppz.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpfktpeppz.o -stdlib=libc++ /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpgkncr5me.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpgkncr5me.o -std=c++14 /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpprtt7c4l.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpprtt7c4l.o -fvisibility=hidden building 'fasttext_pybind' extension /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/theanhnguyen/Library/Python/3.6/include/python3.6m -Isrc -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.6-intel-3.6/python/fastText/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden In file included from python/fastText/pybind/fasttext_pybind.cc:10: src/args.h:12:10: fatal error: 'istream' file not found

include

       ^~~~~~~~~

1 error generated. error: command '/usr/local/bin/clang' failed with exit status 1


Failed building wheel for fasttext Running setup.py clean for fasttext Failed to build fasttext Installing collected packages: fasttext Found existing installation: fasttext 0.8.3 Uninstalling fasttext-0.8.3: Successfully uninstalled fasttext-0.8.3 Running setup.py install for fasttext ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-qo8xyccl-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-o6y5w3oi-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.macosx-10.6-intel-3.6 creating build/lib.macosx-10.6-intel-3.6/fastText copying python/fastText/init.py -> build/lib.macosx-10.6-intel-3.6/fastText copying python/fastText/FastText.py -> build/lib.macosx-10.6-intel-3.6/fastText creating build/lib.macosx-10.6-intel-3.6/fastText/util copying python/fastText/util/init.py -> build/lib.macosx-10.6-intel-3.6/fastText/util copying python/fastText/util/util.py -> build/lib.macosx-10.6-intel-3.6/fastText/util creating build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/init.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/test_configurations.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/test_script.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests running build_ext /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpci6jp7om.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpci6jp7om.o -stdlib=libc++ /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpfxer2cbh.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpfxer2cbh.o -std=c++14 /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpche20bq7.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpche20bq7.o -fvisibility=hidden building 'fasttext_pybind' extension creating build/temp.macosx-10.6-intel-3.6 creating build/temp.macosx-10.6-intel-3.6/python creating build/temp.macosx-10.6-intel-3.6/python/fastText creating build/temp.macosx-10.6-intel-3.6/python/fastText/pybind creating build/temp.macosx-10.6-intel-3.6/src /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/theanhnguyen/Library/Python/3.6/include/python3.6m -Isrc -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.6-intel-3.6/python/fastText/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden In file included from python/fastText/pybind/fasttext_pybind.cc:10: src/args.h:12:10: fatal error: 'istream' file not found

include

         ^~~~~~~~~
1 error generated.
error: command '/usr/local/bin/clang' failed with exit status 1

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

Rolling back uninstall of fasttext Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-qo8xyccl-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-o6y5w3oi-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-qo8xyccl-build/

After I run 'pip3 install .'

cpuhrsch commented 6 years ago

Hello @nguyentheanhhnvntd,

Thank you for your reply.

Could you try replacing

f.write('int main (int argc, char **argv) { return 0; }')

with

f.write('#include <iostream>\n int main (int argc, char **argv) { return 0; }')

on line 75 of setup.py and try again?

Thanks, Christian

nguyentheanhhnvntd commented 6 years ago

MacBook-Pro-cua-The:fastText-master theanhnguyen$ pip3 install . Processing /Users/theanhnguyen/Downloads/fastText-master Requirement already satisfied: pybind11>=2.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Requirement already satisfied: setuptools>=0.7.0 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from fasttext==0.8.22) Building wheels for collected packages: fasttext Running setup.py bdist_wheel for fasttext ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-i8e_zoyg-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpqi7lg973pip-wheel- --python-tag cp36: running bdist_wheel running build running build_py running build_ext /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpgmtfl05w.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpgmtfl05w.o -stdlib=libc++ /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpo04b6anq.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpo04b6anq.o -std=c++14 /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpw8_f34dt.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpw8_f34dt.o -fvisibility=hidden building 'fasttext_pybind' extension /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/theanhnguyen/Library/Python/3.6/include/python3.6m -Isrc -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.6-intel-3.6/python/fastText/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden In file included from python/fastText/pybind/fasttext_pybind.cc:10: src/args.h:12:10: fatal error: 'istream' file not found

include

       ^~~~~~~~~

1 error generated. error: command '/usr/local/bin/clang' failed with exit status 1


Failed building wheel for fasttext Running setup.py clean for fasttext Failed to build fasttext Installing collected packages: fasttext Found existing installation: fasttext 0.8.3 Uninstalling fasttext-0.8.3: Successfully uninstalled fasttext-0.8.3 Running setup.py install for fasttext ... error Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-i8e_zoyg-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-axq0rm5d-record/install-record.txt --single-version-externally-managed --compile: running install running build running build_py creating build creating build/lib.macosx-10.6-intel-3.6 creating build/lib.macosx-10.6-intel-3.6/fastText copying python/fastText/init.py -> build/lib.macosx-10.6-intel-3.6/fastText copying python/fastText/FastText.py -> build/lib.macosx-10.6-intel-3.6/fastText creating build/lib.macosx-10.6-intel-3.6/fastText/util copying python/fastText/util/init.py -> build/lib.macosx-10.6-intel-3.6/fastText/util copying python/fastText/util/util.py -> build/lib.macosx-10.6-intel-3.6/fastText/util creating build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/init.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/test_configurations.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests copying python/fastText/tests/test_script.py -> build/lib.macosx-10.6-intel-3.6/fastText/tests running build_ext /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpez3bzh9w.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpez3bzh9w.o -stdlib=libc++ /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpi5634uvh.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpi5634uvh.o -std=c++14 /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpkt0krk9i.cpp -o var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/tmpkt0krk9i.o -fvisibility=hidden building 'fasttext_pybind' extension creating build/temp.macosx-10.6-intel-3.6 creating build/temp.macosx-10.6-intel-3.6/python creating build/temp.macosx-10.6-intel-3.6/python/fastText creating build/temp.macosx-10.6-intel-3.6/python/fastText/pybind creating build/temp.macosx-10.6-intel-3.6/src /usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -I/Users/theanhnguyen/Library/Python/3.6/include/python3.6m -Isrc -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/fastText/pybind/fasttext_pybind.cc -o build/temp.macosx-10.6-intel-3.6/python/fastText/pybind/fasttext_pybind.o -stdlib=libc++ -DVERSION_INFO="0.8.22" -std=c++14 -fvisibility=hidden In file included from python/fastText/pybind/fasttext_pybind.cc:10: src/args.h:12:10: fatal error: 'istream' file not found

include

         ^~~~~~~~~
1 error generated.
error: command '/usr/local/bin/clang' failed with exit status 1

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

Rolling back uninstall of fasttext Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-i8e_zoyg-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-axq0rm5d-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/fg/95hz138x42ngpgrmhp2x9r7r0000gn/T/pip-i8e_zoyg-build/

still this error:

include 'istream'

         ^~~~~~~~~
1 error generated.
AliWazir commented 6 years ago

Hello, I'm trying to install fasttext after installing C++ but failed to install because of following error. So can any one suggest me what should I do. I also downloaded wheel for fasstext from https://www.lfd.uci.edu/~gohlke/pythonlibs/ and pasted in the same path where anaconda is installed.

es (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" /EHsc /Tpfasttext/fasttext.cpp /Fobuild\temp.win-amd64-3.6\Release\fasttext/fasttext.obj -O3 -pthread -funroll-loops -std=c++0x error: command 'cl.exe' failed: No such file or directory


Failed building wheel for fasttext Running setup.py clean for fasttext Failed to build fasttext Installing collected packages: fasttext Running setup.py install for fasttext ... error

yonipick commented 6 years ago

Hi working on windows 10 got this error when trying to install fasttext

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX64\\x64\\cl.exe' failed with exit status 2

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

Command "c:\users\yoni\appdata\local\continuum\anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Yoni\AppData\Local\Temp\pip-req-build-_lv8kv23\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\Yoni\AppData\Local\Temp\pip-record-q0rsu8fd\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Yoni\AppData\Local\Temp\pip-req-build-_lv8kv23\

SergeyMusaevich commented 6 years ago

Hello @nguyentheanhhnvntd , I have the same "istream" error. Have you already found solution?