'How to install package "wordcloud" in python?

I am trying to install wordcloud in my system using pip. But i have received the below mentioned error. I tried many ways to install but I failed. hope any one from you can help me.

C:\Users\AVATAR>pip install wordcloud
Collecting wordcloud
  Using cached wordcloud-1.6.0.tar.gz (214 kB)
Requirement already satisfied: numpy>=1.6.1 in c:\python\lib\site-packages (from wordcloud) (1.16.4)
Requirement already satisfied: pillow in c:\python\lib\site-packages (from wordcloud) (6.2.1)
Requirement already satisfied: matplotlib in c:\python\lib\site-packages (from wordcloud) (3.1.3)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\python\lib\site-packages (from matplotlib->wordcloud) (1.1.0)
Requirement already satisfied: python-dateutil>=2.1 in c:\python\lib\site-packages (from matplotlib->wordcloud) (2.8.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in c:\python\lib\site-packages (from matplotlib->wordcloud) (2.4.6)
Requirement already satisfied: cycler>=0.10 in c:\python\lib\site-packages (from matplotlib->wordcloud) (0.10.0)
Requirement already satisfied: setuptools in c:\python\lib\site-packages (from kiwisolver>=1.0.1->matplotlib->wordcloud) (40.6.2)
Requirement already satisfied: six>=1.5 in c:\users\avatar\appdata\roaming\python\python37\site-packages (from python-dateutil>=2.1->matplotlib->wordcloud) (1.11.0)
Installing collected packages: wordcloud
    Running setup.py install for wordcloud ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AVATAR\\AppData\\Local\\Temp\\pip-install-resmy70s\\wordcloud\\setup.py'"'"'; __file__='"'"'C:\\Users\\AVATAR\\AppData\\Local\\Temp\\pip-install-resmy70s\\wordcloud\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\AVATAR\AppData\Local\Temp\pip-record-fq23o1gz\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\wordcloud'
         cwd: C:\Users\AVATAR\AppData\Local\Temp\pip-install-resmy70s\wordcloud\
    Complete output (20 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\wordcloud
    copying wordcloud\color_from_image.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\tokenization.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\wordcloud.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\wordcloud_cli.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\_version.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\__init__.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\__main__.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\stopwords -> build\lib.win32-3.7\wordcloud
    copying wordcloud\DroidSansMono.ttf -> build\lib.win32-3.7\wordcloud
    UPDATING build\lib.win32-3.7\wordcloud/_version.py
    set build\lib.win32-3.7\wordcloud/_version.py to '1.6.0'
    running build_ext
    building 'wordcloud.query_integral_image' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\AVATAR\\AppData\\Local\\Temp\\pip-install-resmy70s\\wordcloud\\setup.py'"'"'; __file__='"'"'C:\\Users\\AVATAR\\AppData\\Local\\Temp\\pip-install-resmy70s\\wordcloud\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\AVATAR\AppData\Local\Temp\pip-record-fq23o1gz\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python\Include\wordcloud' Check the logs for full command output.



Solution 1:[1]

Try creating a virtual environment in python and then try pip install wordcloud.

If creating virtual environment doesn't work. Try installing anaconda :

  • install Anaconda
  • open anaconda terminal
  • install wordcloud using pip command
  • launch IDE from anaconda
  • Run program from IDE's terminal

and Done...

Solution 2:[2]

How to install wordcloud

  1. Check for the version of wordcloud available for the version of python and operating system you are using visiting this link: https://pypi.org/project/wordcloud/#history

  2. install wordcloud using below code:

    pip install wordcloud -version-compatible-operatingsystem

Another method to install wordcloud

  1. In Anaconda prompt
  2. conda install -c conda-forge wordcloud

Solution 3:[3]

In the Anaconda prompt, enter: conda install -c https://conda.anaconda.org/conda-forge wordcloud

After this, start python shell, and try to import the wordcloud module. It should be imported successfully

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2
Solution 3 Sayali Shinde