Reputation: 31
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
I have tried everything like updating and etc
Upvotes: 3
Views: 33486
Reputation: 396
After trying around a million and one workarounds without luck, I was finally able to build an Insightface Wheel and install it on Ubuntu 19.10 with Python 3.11.10 (not the official version from the Ubuntu repositories, but my own local installation) doing the following:
sudo apt-get install build-essential libssl-dev libffi-dev
mkdir temp
cd temp
git clone https://github.com/deepinsight/insightface/ .
pip3 install wheel setuptools
pip3 install -r requirements.txt
cd python-package
python3 setup.py bdist_wheel
pip3 install dist/insightface-0.7.3-cp311-cp311-linux_x86_64.whl
I did all of this in an Python virtual environment. And I'm not certain that libffi-dev and libssl-dev are strictly necessary, I just mention them for completeness' sake.
Upvotes: 0
Reputation: 31
This worked for me
first go to https://www.wheelodex.org/projects/insightface/wheels/insightface-0.2.1-py2.py3-none-any.whl/ and then click on Download:link. Go to the folder where you downloaded the wheel, right click and click on open terminal here. in the terminal type pip install insightface-0.2.1-py2.py3-none-any.whl
and then after some time it should be installed.Hope it helps
Upvotes: 3
Reputation: 13030
In Windows, LNK2001 errors and an exit code of 2011 that cause the wheel build to fail are not uncommon. Unfortunately, the solution is not easy to find without a deeper understanding of Python and its build behavior in Windows.
Insightface uses setuptools, Cython, and the Microsoft Visual C++ compiler to perform it's build. How you set up the build environment varies depending on which version of Python you are using. Refer to the Python WindowsCompilers wiki topic for instructions appropriate to your particular Python version.
After that, make sure that you use pip to update or install setuptools and Cython.
In my case I have:
Python 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 22:03:32) [MSC v.1937 64 bit (AMD64)]
Neither the standard Windows Command Prompt nor the Developer Command Prompt for VS2022 were sufficient to get a successful build even after following the instructions in the wiki article. It wasn't until I used the x64 Native Tools Command Prompt for VS 2022 that I was able to get a successful build and install of insightface in Windows.
Upvotes: 0
Reputation: 41
I encountered this issue on my Ubuntu 22, and it was resolved by using sudo apt-get install build-essential
. I hope this is helpful for everyone.
Upvotes: 4
Reputation: 1352
I had the same issue on my desktop where I was building a project on Windows 11.
You need to install Microsoft build tools from this link (or latest) https://aka.ms/vs/17/release/vs_BuildTools.exe
Select: Workloads → Desktop development with C++
Individual Components must be checked:
Hope it helps.
Upvotes: 2