我想创建一个电影推荐系统。我可以安装除lightfm以外的所有依赖项。我在文学上尝试了所有可能的命令,但这根本行不通。无论我做什么,都会不断打印出来:
Collecting lightfm Using cached https://files.pythonhosted.org/packages/e9/8e/5485ac5a8616abe1c673d1e033e2f232b4319ab95424b42499fabff2257f/lightfm-1.15.tar.gz Requirement already satisfied: numpy in /home/elya/.local/lib/python3.5/site-packages (from lightfm) (1.14.5) Requirement already satisfied: requests in /home/elya/.local/lib/python3.5/site-packages (from lightfm) (2.19.1) Requirement already satisfied: scipy>=0.17.0 in /home/elya/.local/lib/python3.5/site-packages (from lightfm) (1.1.0) Requirement already satisfied: urllib3<1.24,>=1.21.1 in /home/elya/.local/lib/python3.5/site-packages (from requests->lightfm) (1.23) Requirement already satisfied: idna<2.8,>=2.5 in /home/elya/.local/lib/python3.5/site-packages (from requests->lightfm) (2.7) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /home/elya/.local/lib/python3.5/site-packages (from requests->lightfm) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in /home/elya/.local/lib/python3.5/site-packages (from requests->lightfm) (2018.4.16) Installing collected packages: lightfm Running setup.py install for lightfm ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-828rqpl2/lightfm/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-record-5d5r6zgf/install-record.txt --single-version-externally-managed --compile: 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/lightfm copying lightfm/init.py -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/lightfm.py -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/data.py -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/evaluation.py -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/_lightfm_fast.py -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/cross_validation.py -> build/lib.linux-x86_64-3.5/lightfm creating build/lib.linux-x86_64-3.5/lightfm/datasets copying lightfm/datasets/init.py -> build/lib.linux-x86_64-3.5/lightfm/datasets copying lightfm/datasets/_common.py -> build/lib.linux-x86_64-3.5/lightfm/datasets copying lightfm/datasets/movielens.py -> build/lib.linux-x86_64-3.5/lightfm/datasets copying lightfm/datasets/stackexchange.py -> build/lib.linux-x86_64-3.5/lightfm/datasets copying lightfm/_lightfm_fast_no_openmp.c -> build/lib.linux-x86_64-3.5/lightfm copying lightfm/_lightfm_fast_openmp.c -> build/lib.linux-x86_64-3.5/lightfm running build_ext building 'lightfm._lightfm_fast_openmp' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/lightfm x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-nLrllb/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c lightfm/_lightfm_fast_openmp.c -o build/temp.linux-x86_64-3.5/lightfm/_lightfm_fast_openmp.o -ffast-math -march=native -fopenmp
>lightfm/_lightfm_fast_openmp.c:20:20: fatal error: Python.h: No such file >or directory
>include "Python.h"
^
compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
>Command "/usr/bin/python3 -u -c "import setuptools, >tokenize;file='/tmp/pip-install->828rqpl2/lightfm/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-record-5d5r6zgf/install->record.txt --single-version-externally->managed --compile" failed with >error code 1 in /tmp/pip-install->828rqpl2/lightfm/
我还尝试为python-dev正确安装头文件和静态库。与软件包管理器一起使用无法在系统范围内安装它们...
> "sudo apt-get install python-dev"
无法解决问题:( 结果:
> E: Package 'python-dev' has no installation candidate
我很高兴获得任何帮助/建议。谢谢!