Collecting fasttext Downloading https://pypi.doubanio.com/packages/a4/86/ff826211bc9e28d4c371668b30b4b2c38a09127e5e73017b1c0cd52f9dfa/fasttext-0.8.3.tar.gz (73kB) Requirement already satisfied: numpy>=1 in /home/appleyuchi/.virtualenvs/python3.5/lib/python3.5/site-packages (from fasttext) Requirement already satisfied: future in /home/appleyuchi/.virtualenvs/python3.5/lib/python3.5/site-packages (from fasttext) Building wheels for collected packages: fasttext Running setup.py bdist_wheel for fasttext: started Running setup.py bdist_wheel for fasttext: finished with status 'error' Complete output from command /home/appleyuchi/.virtualenvs/python3.5/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/fasttext/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 /tmp/tmpemx0n11ppip-wheel- --python-tag cp35: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/fasttext copying fasttext/model.py -> build/lib.linux-x86_64-3.5/fasttext copying fasttext/__init__.py -> build/lib.linux-x86_64-3.5/fasttext warning: build_py: byte-compiling is disabled, skipping. running build_ext building 'fasttext.fasttext' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/fasttext creating build/temp.linux-x86_64-3.5/fasttext/cpp creating build/temp.linux-x86_64-3.5/fasttext/cpp/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./fasttext -I/usr/include/python3.5m -I/home/appleyuchi/.virtualenvs/python3.5/include/python3.5m -c fasttext/fasttext.cpp -o build/temp.linux-x86_64-3.5/fasttext/fasttext.o -O3 -pthread -funroll-loops -std=c++0x cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ fasttext/fasttext.cpp:41:20: fatal error: Python.h: 没有那个文件或目录 compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Running setup.py clean for fasttext Failed to build fasttext Installing collected packages: fasttext Running setup.py install for fasttext: started Running setup.py install for fasttext: finished with status 'error' Complete output from command /home/appleyuchi/.virtualenvs/python3.5/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/fasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_gzvkr54-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/appleyuchi/.virtualenvs/python3.5/include/site/python3.5/fasttext: running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/fasttext copying fasttext/model.py -> build/lib.linux-x86_64-3.5/fasttext copying fasttext/__init__.py -> build/lib.linux-x86_64-3.5/fasttext warning: build_py: byte-compiling is disabled, skipping. running build_ext building 'fasttext.fasttext' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/fasttext creating build/temp.linux-x86_64-3.5/fasttext/cpp creating build/temp.linux-x86_64-3.5/fasttext/cpp/src x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./fasttext -I/usr/include/python3.5m -I/home/appleyuchi/.virtualenvs/python3.5/include/python3.5m -c fasttext/fasttext.cpp -o build/temp.linux-x86_64-3.5/fasttext/fasttext.o -O3 -pthread -funroll-loops -std=c++0x cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ fasttext/fasttext.cpp:41:20: fatal error: Python.h: 没有那个文件或目录 compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for fasttext
Command "/home/appleyuchi/.virtualenvs/python3.5/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/fasttext/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_gzvkr54-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/appleyuchi/.virtualenvs/python3.5/include/site/python3.5/fasttext" failed with error code 1 in /tmp/pycharm-packaging/fasttext/
解决方案:
apt-get install apt-get install python3 python-dev python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev python-pip
然后再安装fasttext即可