0

这是我尝试安装某些库时遇到的错误。我已经尝试将我的 pip 更新到最新版本。我正在使用 python 3.8.5

C:\Users\Deep\Desktop\Sentiment Analysis>pip install lightfm
Collecting lightfm
  Using cached lightfm-1.16.tar.gz (310 kB)
Requirement already satisfied: numpy in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from lightfm) (1.20.1)
Requirement already satisfied: scipy>=0.17.0 in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from lightfm) (1.6.1)
Requirement already satisfied: requests in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from lightfm) (2.11.1)
Requirement already satisfied: scikit-learn in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from lightfm) (0.24.1)
Requirement already satisfied: joblib>=0.11 in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->lightfm) (1.0.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\deep\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->lightfm) (2.1.0)
Using legacy 'setup.py install' for lightfm, since package 'wheel' is not installed.
Installing collected packages: lightfm
    Running setup.py install for lightfm ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\deep\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Deep\\AppData\\Local\\Temp\\pip-install-2woi0con\\lightfm_42fc377b52074fbd9b3c493179e0e9fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\Deep\\AppData\\Local\\Temp\\pip-install-2woi0con\\lightfm_42fc377b52074fbd9b3c493179e0e9fd\\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\Deep\AppData\Local\Temp\pip-record-2y1qyoq6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\deep\appdata\local\programs\python\python39\Include\lightfm'
         cwd: C:\Users\Deep\AppData\Local\Temp\pip-install-2woi0con\lightfm_42fc377b52074fbd9b3c493179e0e9fd\
    Complete output (23 lines):
    Compiling without OpenMP support.
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\lightfm
    copying lightfm\cross_validation.py -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\data.py -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\evaluation.py -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\lightfm.py -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\_lightfm_fast.py -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\__init__.py -> build\lib.win-amd64-3.9\lightfm
    creating build\lib.win-amd64-3.9\lightfm\datasets
    copying lightfm\datasets\movielens.py -> build\lib.win-amd64-3.9\lightfm\datasets
    copying lightfm\datasets\stackexchange.py -> build\lib.win-amd64-3.9\lightfm\datasets
    copying lightfm\datasets\_common.py -> build\lib.win-amd64-3.9\lightfm\datasets
    copying lightfm\datasets\__init__.py -> build\lib.win-amd64-3.9\lightfm\datasets
    copying lightfm\_lightfm_fast_no_openmp.c -> build\lib.win-amd64-3.9\lightfm
    copying lightfm\_lightfm_fast_openmp.c -> build\lib.win-amd64-3.9\lightfm
    running build_ext
    building 'lightfm._lightfm_fast_no_openmp' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\deep\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Deep\\AppData\\Local\\Temp\\pip-install-2woi0con\\lightfm_42fc377b52074fbd9b3c493179e0e9fd\\setup.py'"'"'; __file__='"'"'C:\\Users\\Deep\\AppData\\Local\\Temp\\pip-install-2woi0con\\lightfm_42fc377b52074fbd9b3c493179e0e9fd\\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\Deep\AppData\Local\Temp\pip-record-2y1qyoq6\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\deep\appdata\local\programs\python\python39\Include\lightfm' Check the logs for full command output.
4

1 回答 1

0

尝试像错误所说的那样安装 Visual Studio 的构建工具,你可以在这里https://visualstudio.microsoft.com/downloads/或这里https://visualstudio.microsoft.com/cs/visual-cpp-build -工具/

于 2021-03-25T07:22:07.173 回答