提问人:rishikesh fulari 提问时间:10/9/2023 更新时间:10/9/2023 访问量:42
无法在 Windows 10 上安装 Pylzma。抛出找不到文件错误
unable to install pylzma on windows 10. throws file not found error
问:
我正在尝试遵循需要“pylzma”的代码。但是当我尝试安装它时,我遇到了不同的错误,例如“找不到文件”,如下所示:
(llmenv) D:\LLMs>pip install pylzma
Collecting pylzma
Using cached pylzma-0.5.0.tar.gz (4.2 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pylzma
Building wheel for pylzma (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
copying py7zlib.py -> build\lib.win-amd64-cpython-38
running build_ext
adding support for multithreaded compression
building 'pylzma' extension
creating build\temp.win-amd64-cpython-38
creating build\temp.win-amd64-cpython-38\Release
creating build\temp.win-amd64-cpython-38\Release\src
creating build\temp.win-amd64-cpython-38\Release\src\pylzma
creating build\temp.win-amd64-cpython-38\Release\src\sdk
creating build\temp.win-amd64-cpython-38\Release\src\sdk\C
creating build\temp.win-amd64-cpython-38\Release\src\compat
"D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -DCOMPRESS_MF_MT=1 -Isrc/sdk/C -ID:\Anaconda\envs\llmenv\include -ID:\Anaconda\envs\llmenv\Include "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include" "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC\include" "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" -IC:\Users\rishikesh\AppData\Roaming\Python\Python37\site-packages\tensorflow\include\Eigen\src\Core /Tcsrc/pylzma/pylzma.c /Fobuild\temp.win-amd64-cpython-38\Release\src/pylzma/pylzma.obj
pylzma.c
C:\Users\rishikesh\AppData\Roaming\Python\Python37\site-packages\tensorflow\include\Eigen\src\Core\io.h(14): error C2061: syntax error: identifier 'Eigen'
C:\Users\rishikesh\AppData\Roaming\Python\Python37\site-packages\tensorflow\include\Eigen\src\Core\io.h(14): error C2059: syntax error: ';'
C:\Users\rishikesh\AppData\Roaming\Python\Python37\site-packages\tensorflow\include\Eigen\src\Core\io.h(14): error C2449: found '{' at file scope (missing function header?)
C:\Users\rishikesh\AppData\Roaming\Python\Python37\site-packages\tensorflow\include\Eigen\src\Core\io.h(256): error C2059: syntax error: '}'
D:\Anaconda\envs\llmenv\include\pyconfig.h(192): fatal error C1083: Cannot open include file: 'float.h': No such file or directory
error: command 'D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pylzma
Running setup.py clean for pylzma
Failed to build pylzma
ERROR: Could not build wheels for pylzma, which is required to install pyproject.toml-based projects
我试过了什么?
遵循stackoverflow上提供的类似问题,基本上建议安装Visual studio构建工具:“使用C++进行桌面开发”,如下图所示。
我还尝试卸载所有内容,即所有 Visual Studio 构建工具、SDK、可再发行更新等,然后重新安装所有内容。在重新安装之前,我收到类似的错误,说找不到“io.h”文件。现在,重新安装所有内容后,我收到如上所示的错误。
答: 暂无答案
评论