[Fix] error metadata-generation-failed

The Error “error: metadata-generation-failed”, is an error that is invoked when you are working on python and are trying to install the artic package via pip install gensim. Given below is the snippet of the error you might get:

error: metadata-generation-failed

I would like to share with you the steps I took to fix the “error: metadata-generation-failed”

Why “error: metadata-generation-failed” Error is Seen?

The error, “error: metadata-generation-failed” is seen because, of a recent change in pip, you can simple sove the error by adding –use-deprecated=backtrack-on-build-failures during installation.

The detailed solution to fix the error “error: metadata-generation-failed”, is given below:

How to fix “error: metadata-generation-failed” Error?

To fix the error, you will have to add the following command during the installation of your package: –use-deprecated=backtrack-on-build-failures. it would fix the error: metadata-generation-failed.

To fix the error, “error: metadata-generation-failed”, you will have to follow one the steps mentioned below:

This error is caused because of a change in pip, you can add the following command during the installation of your package:

--use-deprecated=backtrack-on-build-failures

For your reference we will take an example of installing the numpy package, normally you would use pip install numpy, but with the new way you would use the following code:

pip install numpy --use-deprecated=backtrack-on-build-failures

The above method should work fine for windows systems, if you still face the error in your linux based systems then you will have to follow the below mentioned commands and try the above steps again:

sudo apt-get install python-dev 
sudo apt-get install build-essential
python -m pip install -U pip or python3 -m pip install -U pip 
pip3 install --upgrade setuptools

This should fix the error “error: metadata-generation-failed”.

Conclusion

To fix the error “error: metadata-generation-failed”, you will have to add the following command during the installation of your package: –use-deprecated=backtrack-on-build-failures.