win10 installation home assistant problem

Using pip to install homeassistant encountered the following problems, and could not successfully install ciso8601

Building wheels for collected packages: ciso8601
  Building wheel for ciso8601 (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for ciso8601 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win32-cpython-39
      creating build\lib.win32-cpython-39\ciso8601
      copying ciso8601\__init__.pyi -> build\lib.win32-cpython-39\ciso8601
      copying ciso8601\py.typed -> build\lib.win32-cpython-39\ciso8601
      running build_ext
      building 'ciso8601' 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/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ciso8601
Failed to build ciso8601
ERROR: Could not build wheels for ciso8601, which is required to install pyproject.toml-based projects

Let me talk about the solution first:

The C++ compilation tool is not installed in the system, causing pip to fail to compile the relevant code, which is the prompt in the above error message

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/

Try flow:

1. Update the versions of pip and python

2. Install the corresponding whl file, but I searched for the corresponding link, and there is no ciso8601 whl file at all

To install the Microsoft C++ Build Tools tool, refer to this link:

Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools" solution - Zhihu.com

After installing the compilation tool, reinstall ciso8610, the installation is successful

C:\Users\Administrator>pip3 install ciso8601
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting ciso8601
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/db/50/ed16ee9a645196a29d2b7222d77e7d266f63f7a6042f2ac6cbb18a2b98e4/ciso8601-2.2.0.tar.gz (18 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: ciso8601
  Building wheel for ciso8601 (pyproject.toml) ... done
  Created wheel for ciso8601: filename=ciso8601-2.2.0-cp39-cp39-win32.whl size=14159 sha256=8589c0945876044d6824c0618f794c8f18be2f01024a090defbf986d7262e870
  Stored in directory: c:\users\administrator\appdata\local\pip\cache\wheels\67\1f\93\f5d692f0e81d6c353cf764e0e98af724f5b6b8b7a7e587ad31
Successfully built ciso8601
Installing collected packages: ciso8601
Successfully installed ciso8601-2.2.0

It is recommended to use WIN+ virtual machine to install home assistant, because even if there is a compatibility problem with win, even if the installation is complete, it will prompt at runtime: Home Assistant only supports Linux, OSX and Windows using WSL

Guess you like

Origin blog.csdn.net/Wangguang_/article/details/126862468