[Solved] error: legacy-install-failure

When I am trying to install gensim python package via pip install gensim. Then I am facing note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
, this error.

In this article, we will discuss about this error: legacy-install-failure error in Python. And how to resolve the error all the possible solutions with examples.

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

I am just installed gensim python package via pip install gensim, then I am getting error looks like the below:

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

How To Fix error: legacy-install-failure?

There are different ways to fix error: legacy-install-failure this error. Let us take a look at every solution.

  • How To Fix 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