0

尝试在 Windows 10 上安装 Gpt-2 时,我在尝试 pip install requirements.txt 时遇到了这个错误消息

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\zachz\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\zachz\\AppData\\Local\\Temp\\pip-install-jl2m7j89\\regex_cf4be6062b3c4b03a36ecb4c50ee4889\\setup.py'"'"'; __file__='"'"'C:\\Users\\zachz\\AppData\\Local\\Temp\\pip-install-jl2m7j89\\regex_cf4be6062b3c4b03a36ecb4c50ee4889\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\zachz\AppData\Local\Temp\pip-record-b328v2hb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\zachz\AppData\Local\Programs\Python\Python39\Include\regex'
         cwd: C:\Users\zachz\AppData\Local\Temp\pip-install-jl2m7j89\regex_cf4be6062b3c4b03a36ecb4c50ee4889\
    Complete output (13 lines):
    C:\Users\zachz\AppData\Local\Programs\Python\Python39\lib\site-packages\setuptools\dist.py:463: UserWarning: Normalizing '2017.04.05' to '2017.4.5'
      warnings.warn(tmpl.format(**locals()))
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    copying Python3\regex.py -> build\lib.win-amd64-3.9
    copying Python3\_regex_core.py -> build\lib.win-amd64-3.9
    copying Python3\test_regex.py -> build\lib.win-amd64-3.9
    running build_ext
    building '_regex' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\zachz\AppData\Local\Programs\Python\Python39\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\zachz\\AppData\\Local\\Temp\\pip-install-jl2m7j89\\regex_cf4be6062b3c4b03a36ecb4c50ee4889\\setup.py'"'"'; __file__='"'"'C:\\Users\\zachz\\AppData\\Local\\Temp\\pip-install-jl2m7j89\\regex_cf4be6062b3c4b03a36ecb4c50ee4889\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\zachz\AppData\Local\Temp\pip-record-b328v2hb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\zachz\AppData\Local\Programs\Python\Python39\Include\regex' Check the logs for full command output.

错误消息说我需要 Visual C++ 14.0 或更高版本,因此我在重新启动计算机之前通过 Microsoft Buildtools 以及可再发行包安装了它。

通过 Chocolatey 使用 list 命令,表明我已经安装了 Visual C++

Microsoft Visual C++ 2005 Redistributable|8.0.61001
Microsoft Visual C++ 2005 Redistributable (x64)|8.0.61000
Microsoft Visual C++ 2008 Redistributable - x86 9.0.30729.17|9.0.30729
Microsoft Visual C++ 2013 Redistributable (x86) - 12.0.30501|12.0.30501.0
Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.30.30704|14.30.30704.0

但我仍然收到上面显示的完全相同的错误消息。在这一点上,我不知道该怎么做。

4

0 回答 0