Python is by far one of the easiest languages to learn and develop. However, as easy as programming might become, it’ll still have a few random bugs and features that the programmer can encounter.
This article discusses the “error: failed building wheel for Wordcloud” issue and gives you four fixes to solve the problem.
Also read: Is Python case sensitive when dealing with identifiers?
Check the Python version
First, check the Python version to ensure that you’re using Python 3.6 or lower as wordcloud isn’t supported in Python 3.7 or above. You can check your Python version by running the following command.
python -V
Install using the requirements file
Every Python project comes with a requirements.txt file which includes all the links to every dependency the project uses. Instead of installing all the libraries and dependencies separately, users can use pip to install this requirements file instead of saving them time.
Try running the following command to install the requirements file in the current project and install wordcloud too in the process.
sudo pip install -r requirements.txt
Also read: What is OWASP? OWASP Top 10 Vulnerabilities
Try using Conda
If Python’s goto package manager pip didn’t do the trick for you, you could try installing packages with Conda instead. Try running the following command in your terminal window.
conda install -c https://conda.anaconda.org/conda-forge wordcloud
Download the Wheel fine manually
If pip can’t automatically download and fetch the required file, you can do so manually and force pip to install the package.
Step 1: Head over to this link to download the required wheel file, depending on what version of wordcloud you want.
Step 2: Navigate to the directory where the downloaded file is and use the following command to install the package.
python -m pip install [name of the package file]
Also read: How to solve the Tower of Hanoi problem using Python?