dchatel / vid-faceswap

32 stars 3 forks source link

facing problems while installing insightface. little help please. #5

Closed runner22k closed 1 year ago

runner22k commented 1 year ago

It could be related to the wrong version of insightface. You should use 0.7.3 and not 0.2.1. You can fix that by running pip install -U insightface in the stable diffusion environment.

i am unable to install insightface and getting below error

AppData\Local\Temp\pip-build-env-mslm00mj\overlay\Lib\site-packages\setuptools\command\build_py.py:201: _Warning: Package 'insightface.data.objects' is absent from the `packages` configuration.
      !!

              ********************************************************************************
              ############################
              # Package would be ignored #
              ############################
              Python recognizes 'insightface.data.objects' as an importable package[^1],
              but it is absent from setuptools' `packages` configuration.

              This leads to an ambiguous overall configuration. If you want to distribute this
              package, please make sure that 'insightface.data.objects' is explicitly added
              to the `packages` configuration field.

              Alternatively, you can also rely on setuptools' discovery methods
              (for example by using `find_namespace_packages(...)`/`find_namespace:`
              instead of `find_packages(...)`/`find:`).

              You can read more about "package discovery" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

              If you don't want 'insightface.data.objects' to be distributed and are
              already explicitly excluding 'insightface.data.objects' via
              `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
              you can try to use `exclude_package_data`, or `include-package-data=False` in
              combination with a more fine grained `package-data` configuration.

              You can read more about "package data files" on setuptools documentation page:

              - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

              [^1]: For Python, any directory (with suitable naming) can be imported,
                    even if it does not contain any `.py` files.
                    On the other hand, currently there is no concept of package data
                    directory, all directories are treated like packages.
              ********************************************************************************

      !!
        check.warn(importable)
      creating build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      copying insightface\thirdparty\face3d\mesh\cython\mesh_core.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.cpp -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      creating build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\Tom_Hanks_54745.png -> build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\mask_black.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\mask_blue.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\mask_green.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\mask_white.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
      copying insightface\data\images\t1.jpg -> build\lib.win-amd64-cpython-310\insightface\data\images
      creating build\lib.win-amd64-cpython-310\insightface\data\objects
      copying insightface\data\objects\meanshape_68.pkl -> build\lib.win-amd64-cpython-310\insightface\data\objects
      copying insightface\thirdparty\face3d\mesh\cython\mesh_core.h -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.c -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      copying insightface\thirdparty\face3d\mesh\cython\mesh_core_cython.pyx -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      copying insightface\thirdparty\face3d\mesh\cython\setup.py -> build\lib.win-amd64-cpython-310\insightface\thirdparty\face3d\mesh\cython
      running build_ext
      building 'insightface.thirdparty.face3d.mesh.cython.mesh_core_cython' 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 insightface
Failed to build insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects

After installing MS visual C++ 14 Build tools and restarting PC, I am getting below error

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Iinsightface/thirdparty/face3d/mesh/cython -IC:\Users\NewUser\AppData\Local\Temp\pip-build-env-7i03jz6u\overlay\Lib\site-packages\numpy\core\include -ID:\AI\stable-diffusion-webui\venv\include -IC:\Users\NewUser\AppData\Local\Programs\Python\Python310\include -IC:\Users\NewUser\AppData\Local\Programs\Python\Python310\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" /EHsc /Tpinsightface/thirdparty/face3d/mesh/cython/mesh_core.cpp /Fobuild\temp.win-amd64-cpython-310\Release\insightface/thirdparty/face3d/mesh/cython/mesh_core.obj
      mesh_core.cpp
      C:\Users\NewUser\AppData\Local\Temp\pip-install-1z0cy9qc\insightface_840ebedebbbc47adb8df9f01373db97d\insightface\thirdparty\face3d\mesh\cython\mesh_core.h(4): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.36.32532\\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 insightface
Failed to build insightface
ERROR: Could not build wheels for insightface, which is required to install pyproject.toml-based projects
runner22k commented 1 year ago

reinstalling Visual studio build tools 2022 and installing windows 11 SDK solved it.