close

[Solved] error: legacy-install-failure

To solve error: legacy-install-failure You just need to update Your PIP and then try to update your wheel and then setuptools and then your error will be resolved.

How error: legacy-install-failure Error Occurs?

I am trying to install gensim Python Package But I am facing the following error while installing.

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

So here I am writing all possible solutions that I have tried to resolve this error.

Solution 1: Upgrade pip, wheel, and setup tools

  1. First Of all Just Upgrade your pip with this command line python -m pip install –upgrade pip
  2. Then, Upgrade your wheel with this Commandline pip install –upgrade wheel
  3. Now, Try to Upgrade your setuptools with this commandline pip install –upgrade setuptools
  4. Now, Try to install gensim again with this command: pip install gensim OR pip3 install gensim.
  5. Hope Now, Your error must be solved.

Solution 2: Use Unofficial Windows Binaries

Try to use Unofficial Windows Binaries for Python Extension Packages If you are windows 110 OR 11(x64) and python 3.10 Then you should take this file: gensim‑4.1.2‑cp310‑cp310‑win_amd64.whl. Hope Now, Your error should be solved.

Solution 3: Download Microsoft c++ build tools

Try To Download Microsoft c++ build tools. And then Install It in Your system. Now, Make Sure to Check the Desktop development with C++ and install it as given in the below screenshot.

You can also achieve the same automatically using the following command.

vs_buildtools.exe --norestart --passive --downloadThenInstall --includeRecommended --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.MSBuildTools

as the installation is complete you can install gensim again with this command: pip install gensim OR pip3 install gensim. Now, your error must be solved.

Solution 4: Run this command

Just run all the given commands one by one.

python - m pip install – upgrade pip
pip install - upgrade wheel
pip install - upgrade setuptools

Now, Your error will be solved.

Frequently Asked Questions

  1. How To Solve error: legacy-install-failure?

    To Solve error: legacy-install-failure Try to use Unofficial Windows Binaries for Python Extension Packages If you are windows 110 OR 11(x64) and python 3.10 Then you should take this file: gensim‑4.1.2‑cp310‑cp310‑win_amd64.whl. Hope Now, Your error should be solved.

  2. error: legacy-install-failure

    To Solve error: legacy-install-failure Then, Upgrade your wheel with this Commandline pip install –upgrade wheel Now, Try to Upgrade your setuptools with this commandline pip install –upgrade setuptools Now, Try to install gensim again with this command: pip install gensim OR pip3 install gensim. Hope Now, Your error must be solved.

Conclusion

You need to upgrade PIP, Wheel and setuptools will resolve this error. Hope We solved Your error. Comment below with Your thoughts and your queries. Also, Comment below on which solution worked for you.

Also, Read

3 thoughts on “[Solved] error: legacy-install-failure”

Leave a Comment