unable to install pylzma on windows 10. throws file not found error

162 views Asked by At

I am trying to follow along a code that requires 'pylzma'. But as I try to install it, I face different errors like 'file not found' as below :

    (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

What I tried?

Followed similar questions available on stackoverflow, which basically suggest to install Visual studio Build tools specifically : 'Desktop development with C++' as given in the image below.

enter image description here

I also tried uninstalling everything i.e. all the visual studio build tools, SDK, redistributable updates etc and reinstalled all. Prior to reinstallation, I was getting similar error saying 'io.h' file not found. Now, after reinstalling everything am getting an error as shown above.

0

There are 0 answers