我一直在努力实现这一目标。所以请接受任何建议。我试图在我的Windows上安装lightfm,但我一直在控制这个错误
Collecting lightfm
Using cached lightfm-1.12.tar.gz
Requirement already satisfied: numpy in c:\users\hp\appdata\local\programs\python\python35\lib\site-packages (from light
fm)
Requirement already satisfied: scipy>=0.17.0 in c:\users\hp\appdata\local\programs\python\python35\lib\site-packages (fr
om lightfm)
Requirement already satisfied: requests in c:\users\hp\appdata\local\programs\python\python35\lib\site-packages (from li
ghtfm)
Building wheels for collected packages: lightfm
Running setup.py bdist_wheel for lightfm ... error
Complete output from command c:\users\hp\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, t
okenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-gao0_4o3\\lightfm\\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 C:
\Users\hp\AppData\Local\Temp\tmpvva8cxrepip-wheel- --python-tag cp35:
Compiling without OpenMP support.
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\lightfm
copying lightfm\evaluation.py -> build\lib.win-amd64-3.5\lightfm
copying lightfm\lightfm.py -> build\lib.win-amd64-3.5\lightfm
copying lightfm\_lightfm_fast.py -> build\lib.win-amd64-3.5\lightfm
copying lightfm\__init__.py -> build\lib.win-amd64-3.5\lightfm
creating build\lib.win-amd64-3.5\lightfm\datasets
copying lightfm\datasets\movielens.py -> build\lib.win-amd64-3.5\lightfm\datasets
copying lightfm\datasets\stackexchange.py -> build\lib.win-amd64-3.5\lightfm\datasets
copying lightfm\datasets\_common.py -> build\lib.win-amd64-3.5\lightfm\datasets
copying lightfm\datasets\__init__.py -> build\lib.win-amd64-3.5\lightfm\datasets
copying lightfm\_lightfm_fast_no_openmp.c -> build\lib.win-amd64-3.5\lightfm
copying lightfm\_lightfm_fast_openmp.c -> build\lib.win-amd64-3.5\lightfm
running build_ext
building 'lightfm._lightfm_fast_no_openmp' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\lightfm
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\u
sers\hp\appdata\local\programs\python\python35\include -Ic:\users\hp\appdata\local\programs\python\python35\include "-IC
:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10
240.0\ucrt" /Tclightfm/_lightfm_fast_no_openmp.c /Fobuild\temp.win-amd64-3.5\Release\lightfm/_lightfm_fast_no_openmp.obj
-ffast-math -march=native
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
cl : Command line warning D9002 : ignoring unknown option '-march=native'
_lightfm_fast_no_openmp.c
c:\users\hp\appdata\local\programs\python\python35\include\pyconfig.h(243): fatal error C1083: Cannot open include fil
e: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit st
atus 2
----------------------------------------
Failed building wheel for lightfm
Running setup.py clean for lightfm
Complete output from command c:\users\hp\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, t
okenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-gao0_4o3\\lightfm\\setup.py';f=getattr(tokenize, 'open'
, open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
Compiling without OpenMP support.
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --all not recognized
----------------------------------------
Failed cleaning build dir for lightfm
Failed to build lightfm
Installing collected packages: lightfm
Running setup.py install for lightfm ... error
Complete output from command c:\users\hp\appdata\local\programs\python\python35\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-build-gao0_4o3\\lightfm\\setup.py';f=getattr(tokenize, 'ope
n', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --recor
d C:\Users\hp\AppData\Local\Temp\pip-eybv98gb-record\install-record.txt --single-version-externally-managed --compile:
Compiling without OpenMP support.
running install
running build
running build_py
running build_ext
building 'lightfm._lightfm_fast_no_openmp' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:
\users\hp\appdata\local\programs\python\python35\include -Ic:\users\hp\appdata\local\programs\python\python35\include "-
IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.
10240.0\ucrt" /Tclightfm/_lightfm_fast_no_openmp.c /Fobuild\temp.win-amd64-3.5\Release\lightfm/_lightfm_fast_no_openmp.o
bj -ffast-math -march=native
cl : Command line warning D9002 : ignoring unknown option '-ffast-math'
cl : Command line warning D9002 : ignoring unknown option '-march=native'
_lightfm_fast_no_openmp.c
c:\users\hp\appdata\local\programs\python\python35\include\pyconfig.h(243): fatal error C1083: Cannot open include f
ile: 'basetsd.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit
status 2
----------------------------------------
Command "c:\users\hp\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\
Users\\hp\\AppData\\Local\\Temp\\pip-build-gao0_4o3\\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 C:\Users\hp\AppData\Lo
cal\Temp\pip-eybv98gb-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1
in C:\Users\hp\AppData\Local\Temp\pip-build-gao0_4o3\lightfm\
我已经安装了microsoft visual c ++ 14甚至miniconda,但仍然是同样的错误。欢迎任何建议。提前致谢
您是否尝试通过pip或通过其Git-repository安装它?
他们的documentation说:
使用pip:
pip install lightfm
从pypi安装。一切都应该在Linux上运行,OSX使用Homebrew Python,而Windows使用Miniconda。
您是否使用OS适当的包管理器?你确定它应该适用于你似乎正在使用的python3.5吗?
请注意their git-page,只有Linux操作系统似乎有完整的通行证,其他主要操作系统(macOS en Windows)没有..这让我相信pip-install可能仍然不稳定。也许你可以试试开发安装技巧?或者在Git上提出问题。
试试这个选项:
$ conda install -c conda-forge lightfm
在Windows操作系统上,我和你有同样的问题。尝试使用conda安装软件包,方法是运行以下命令之一:
conda install -c conda-forge lightfm
conda install -c conda-forge/label/gcc7 lightfm
conda install -c conda-forge/label/cf201901 lightfm
第三个命令行为我工作。