Fixing issue – Python Cannot install module spaCy ( pip install spacy does not work )

Python Cannot install module spaCy ( pip install spacy does not work ) is an error which occurs because of many reasons when you try to download a python package ( in this case spaCy ).

My goal here is to provide a detailed explanation of the error and how you can fix it, we will also check out other options that can help you get rid of this problem for good.

Exploring the Error : Python Cannot install module spaCy ( pip install spacy does not work )

This is an error which occurs because of many reasons when you try to download a python package ( in this case spaCy ).

Please check out the error message bellow and make sure you have the same message.

                                                                       #
failed with error code 1 in C:\Users\...\AppData\Local\Temp\pip-install-6vcdnb_4\numpy\
                                                                       #

I hope one of the solutions bellow will help you solve the problem and get rid of the error for good.

Solution 1 : Remove the 32 bit version of Python and install the 64 bit version, upgrade setuptools and pip

This error occurs because of many reasons when you want to download a package. Of course now we have a problem with spaCy.

We have a couple of methods to solve the issue and this is the first one of them. If you have the 32 bit version of Python Read This. And if you have the 64 bit version of Python then this method is not for you. You can try the second method instead.

First, you should remove the 32 bit version of Python and then install the 64 bit version.

The second step is to upgrade pip. Here is a great article describing how to do it, step by step : https://datatofish.com/upgrade-pip/

Now, you should upgrade setuptools using pip like in the example bellow.

                                                                       #
pip install --upgrade setuptools
                                                                       #

I hope this method solved your issue, check out the method bellow if this one did not work.

Solution 2 : Correctly install spacy after upgrading pip

Sometimes, the problem is strictly pip related. With this method we will fix all pip related problems before installing spacy.

The first thing we should do is to delete the pip cache folder.

Navigate to this directory, then completely delete the folder.

                                                                       #
C:\Users\...\AppData\Local\pip\cache
                                                                       #

The second step is to upgrade pip using the command bellow.

                                                                       #
python -m pip install --upgrade pip
                                                                       #

Finally, you can install spacy with your newly upgraded pip

                                                                       #
python -m pip install spacy
                                                                       #

I hope the fixes above fixed your problem and I hope the error is gone. Thank you for reaching the end of this blog post.

Summing-up : 

That’s it fellow developers, this is the end of this guide, I hope you found this useful in solving the error : Python Cannot install module spaCy pip install spacy does not work , if you have the means and want to help, please support our work on our Kofi account.

Thank you for reading my blog post to the end, If you want to learn more about the Python programming language, check out the official Python Documentation : https://docs.python.org/3/