Fixing Python Shapely OSError: [WinError 126] The specified module could not be found

Python Shapely OSError: [WinError 126] The specified module could not be found is a very popular error which occurs when you try to install Shapely.

I’m going to provide a detailed and clear explanation of why this error is happening and how to solve it, I am also going to present other ways to get rid of this problem for good.

Exploring the Python Shapely OSError: [WinError 126] The specified module could not be found

This is an error which occurs when you try to install Shapely.

Check out the error message then please check that you have exactly the same message.

                                                                       #
OSError: [WinError 126] The specified module could not be found
                                                                       #

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

Solution 1 : Download and install the shapely wheel

The first solution is to download and install the shapely wheel.

This is the official link of the Shapely whl file :

http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely

You can install the wheel using this command

                                                                       #
python -m pip install Shapely‑1.8.2‑pp38‑pypy38_pp73‑win_amd64.whl
                                                                       #

I hope the wheel installation method solved the problem, please try the method bellow if this method did not do the trick.

Solution 2 : Correctly use conda to install Shapely

pip install shapely , does not work for 99 percent of users. Instead you should use conda

                                                                       #
conda install shapely
                                                                       #

For most people the command above should solve the issue, if that is not the case you can try using

–channel=conda-forge

                                                                       #
conda install shapely --channel=conda-forge
                                                                       #

An alternative command you can use is the following command

                                                                       #
conda install -c conda-forge shapely
                                                                       #

I hope using conda helped you solve the problem, I hope you got rid of the error for good, thank you for reaching the end of this post.

Summing-up : 

I hope this article has helped you solve the error : Python Shapely OSError WinError 126 The specified module could not be found , If you like our efforts, please consider donating to 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/