amueller / word_cloud

A little word cloud generator in Python
https://amueller.github.io/word_cloud
MIT License
10.1k stars 2.31k forks source link

Could not build wheels for wordcloud - python 3.11.1 64 bit #725

Closed scign closed 1 year ago

scign commented 1 year ago

Description

Error installing wordcloud

Steps/Code to Reproduce

pip install wordcloud

Expected Results

Successful installation of the wordcloud package.

Actual Results

Collecting wordcloud Using cached wordcloud-1.9.1.1.tar.gz (222 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Requirement already satisfied: numpy>=1.6.1 in c:\temp\venvs\spacy\lib\site-packages (from wordcloud) (1.24.3) Requirement already satisfied: pillow in c:\temp\venvs\spacy\lib\site-packages (from wordcloud) (9.5.0) Requirement already satisfied: matplotlib in c:\temp\venvs\spacy\lib\site-packages (from wordcloud) (3.7.1) Requirement already satisfied: contourpy>=1.0.1 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (1.0.7) Requirement already satisfied: cycler>=0.10 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (4.39.3) Requirement already satisfied: kiwisolver>=1.0.1 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (1.4.4) Requirement already satisfied: packaging>=20.0 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (23.1) Requirement already satisfied: pyparsing>=2.3.1 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (3.0.9) Requirement already satisfied: python-dateutil>=2.7 in c:\temp\venvs\spacy\lib\site-packages (from matplotlib->wordcloud) (2.8.2) Requirement already satisfied: six>=1.5 in c:\temp\venvs\spacy\lib\site-packages (from python-dateutil>=2.7->matplotlib->wordcloud) (1.16.0) Building wheels for collected packages: wordcloud Building wheel for wordcloud (setup.py): started Building wheel for wordcloud (setup.py): finished with status 'error' Running setup.py clean for wordcloud Failed to build wordcloud error: subprocess-exited-with-error

python setup.py bdist_wheel did not run successfully. exit code: 1

[20 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\color_from_image.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\tokenization.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\wordcloud.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\wordcloud_cli.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud_version.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud__init.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\main__.py -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\stopwords -> build\lib.win-amd64-cpython-311\wordcloud copying wordcloud\DroidSansMono.ttf -> build\lib.win-amd64-cpython-311\wordcloud UPDATING build\lib.win-amd64-cpython-311\wordcloud/_version.py set build\lib.win-amd64-cpython-311\wordcloud/_version.py to '1.9.1.1' running build_ext building 'wordcloud.query_integral_image' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for wordcloud ERROR: Could not build wheels for wordcloud, which is required to install pyproject.toml-based projects

Versions

Windows-10-10.0.19045-SP0 Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] NumPy 1.24.3 matplotlib 3.7.1

amueller commented 1 year ago

Thanks for reporting. That's a bit strange, since there should be a wheel for 64 bit windows on python 3.11. Can you maybe try downloading the wheel directly and see if it installs or why it's not working: https://files.pythonhosted.org/packages/a5/b7/338f0555c0380469d80fcd558d77a121d63e86df27a75203b2d476b7fcbb/wordcloud-1.9.1.1-cp37-cp37m-win_amd64.whl

amueller commented 1 year ago

You can also try this:

from packaging.tags import sys_tags

tags = sys_tags()

print([str(tag) for tag in tags])

to see what the tags are for your current environment.

Nextlvlanalytics commented 1 year ago

Im having the same issue as above. I tried to grab the .whl as directed but had compatibility errors there too.

amueller commented 1 year ago

@Nextlvlanalytics can you say what the output for the commands I gave is?

smatthys commented 1 year ago

Hi, I have also the same problem on two systems I use. This one is a Fedora 28 with Python 3.11.

"Buildbuild/temp.linux-x86_64-cpython-311/wordcloud/query_integral_image.o wordcloud/query_integral_image.c:6:10: fatal error: Python.h: No such file or directory 6 | #include "Python.h"ing wheel for wordcloud (pyproject.toml) did not run successfully."

pip_wordcloud.txt

amueller commented 1 year ago

@smatthys Can you please provide the output of

from packaging.tags import sys_tags

tags = sys_tags()

print([str(tag) for tag in tags])

on both systems?

smatthys commented 1 year ago

Hi, thx. The one on Fedora38 looks a little artistic. ;-)

fedora38_python_WordCloud.txt windows11_python_WordCloud.txt

amueller commented 1 year ago

ah there was some issue with the wheels for 3.11, it seems. I'll have to look into it.

smatthys commented 1 year ago

Just to let you know I have a working WordCloud setup on my main Wind11 machine. This machine worked flawless from the start. It's only when I wanted it on my laptop and Linux PC I encountered the 'wheels' issue.

working_windows11_python_WordCloud.txt

amohajerani commented 1 year ago

@amueller I am trying to install this in a docker image, and get this error:

Building wheels for collected packages: wordcloud
  Building wheel for wordcloud (setup.py): started
Killed
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 137
smatthys commented 1 year ago

@amohajerani

ah there was some issue with the wheels for 3.11, it seems. I'll have to look into it.

Install python3.10 make a venv environment (If you want to keep python3.11) and select it, there it installs and works perfectly.

amueller commented 1 year ago

required some more fixes, should be good now for 3.11