[Solved] error: legacy-install-failure

Hello readers, Today In this article I am going to show you how to Solve – error: legacy-install-failure in Python. So here I will explain all the possible solutions.

Without wasting your time, Let’s start This Article to Solve This Error.

How to error: legacy-install-failure Error Occurs?

This is a common error in Python. When i am trying to install gensim python package via pip install gensim, but I got the following error. It looks as like below:

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

So here are all the possible solutions that I tried to fix this error.

How To Solve error: legacy-install-failure?

  • How To Solve error: legacy-install-failure?

To Solve error: legacy-install-failure 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. I hope your error is now solved.

  • error: legacy-install-failure

To Solve error: legacy-install-failure, you have to upgrade wheel with this Command 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. I hope now your error will be solved.

Solution 1: Upgrade pip, wheel and setuptools

  1. First you have to 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.

Now, your error will 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.

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 installation is complete you can install gensim again with this command: pip install gensim OR pip3 install gensim. Now, your error must be solved.

Conclusion

In this article, we have discussed what causes the error and we have discussed ways to fix the error.

we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Categories