user2989420
user2989420

Reputation: 31

Cant get pip to install wordcloud on mac 10.13 python 3.11

output from pip install wordcloud

Collecting wordcloud
  Using cached wordcloud-1.8.2.2.tar.gz (220 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.6.1  (from wordcloud) (1.23.4)
Requirement already satisfied: pillow  (from wordcloud) (9.3.0)
Requirement already satisfied: matplotlib (from wordcloud) (3.6.0)
Requirement already satisfied: contourpy>=1.0.1 (from matplotlib->wordcloud) (1.0.5)
Requirement already satisfied: cycler>=0.10  (from matplotlib->wordcloud) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 (from matplotlib->wordcloud) (4.38.0)
Requirement already satisfied: kiwisolver>=1.0.1  (from matplotlib->wordcloud) (1.4.4)
Requirement already satisfied: packaging>=20.0 i(from matplotlib->wordcloud) (21.3)
Requirement already satisfied: pyparsing>=2.2.1 (from matplotlib->wordcloud) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 (from matplotlib->wordcloud) (2.8.2)
Requirement already satisfied: six>=1.5 (from python-dateutil>=2.7->matplotlib->wordcloud) (1.16.0)
Building wheels for collected packages: wordcloud
  Building wheel for wordcloud (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/wordcloud_cli.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/_version.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/tokenization.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/wordcloud.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/color_from_image.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/__main__.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/stopwords -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/DroidSansMono.ttf -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      UPDATING build/lib.macosx-10.9-universal2-cpython-311/wordcloud/_version.py
      set build/lib.macosx-10.9-universal2-cpython-311/wordcloud/_version.py to '1.8.2.2'
      running build_ext
      building 'wordcloud.query_integral_image' extension
      creating build/temp.macosx-10.9-universal2-cpython-311
      creating build/temp.macosx-10.9-universal2-cpython-311/wordcloud
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g "-I/Users/mikebeason/Dropbox/My Mac (Mike’s iMac)/Documents/VisualWorkspace/GettingStarted/.venv/include" -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c wordcloud/query_integral_image.c -o build/temp.macosx-10.9-universal2-cpython-311/wordcloud/query_integral_image.o
      wordcloud/query_integral_image.c:196:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.h"
                 ^~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for wordcloud
  Running setup.py clean for wordcloud
Failed to build wordcloud
Installing collected packages: wordcloud
  Running setup.py install for wordcloud ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for wordcloud did not run successfully.
  │ exit code: 1
  ╰─> [29 lines of output]
      running install
      /Users/mikebeason/Dropbox/My Mac (Mike’s iMac)/Documents/VisualWorkspace/GettingStarted/.venv/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/wordcloud_cli.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/_version.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/tokenization.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/wordcloud.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/color_from_image.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/__main__.py -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/stopwords -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      copying wordcloud/DroidSansMono.ttf -> build/lib.macosx-10.9-universal2-cpython-311/wordcloud
      UPDATING build/lib.macosx-10.9-universal2-cpython-311/wordcloud/_version.py
      set build/lib.macosx-10.9-universal2-cpython-311/wordcloud/_version.py to '1.8.2.2'
      running build_ext
      building 'wordcloud.query_integral_image' extension
      creating build/temp.macosx-10.9-universal2-cpython-311
      creating build/temp.macosx-10.9-universal2-cpython-311/wordcloud
      clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g "-I/Users/mikebeason/Dropbox/My Mac (Mike’s iMac)/Documents/VisualWorkspace/GettingStarted/.venv/include" -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c wordcloud/query_integral_image.c -o build/temp.macosx-10.9-universal2-cpython-311/wordcloud/query_integral_image.o
      wordcloud/query_integral_image.c:196:12: fatal error: 'longintrepr.h' file not found
        #include "longintrepr.h"
                 ^~~~~~~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> wordcloud

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I have tried install from a package and also using brew but still end up at the same place. Do I need to have a C compiler installed to get this working as I understand wordcloud has C code in it? Need some help in interpreting the error and what need to be done to resolve the problem.

Upvotes: 2

Views: 3965

Answers (1)

benekreng
benekreng

Reputation: 21

I believe Wordcloud is not compatible with python 3.11. I had the same problem, changed to pyhton 3.9 and it worked

Upvotes: 2

Related Questions