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

Unable to install on Python 3.10 MacBook conda #718

Closed zhimin-z closed 1 year ago

zhimin-z commented 1 year ago

Description

I failed to install the latest version on the virtual environment in Conda

Steps/Code to Reproduce

Error log:

(amtm) jimmy@Jimmys-MacBook-Air Asset-Management-Topic-Modeling % pip install wordcloud==1.8.2.2
Collecting wordcloud==1.8.2.2
  Using cached wordcloud-1.8.2.2.tar.gz (220 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.6.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from wordcloud==1.8.2.2) (1.23.5)
Requirement already satisfied: pillow in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from wordcloud==1.8.2.2) (9.3.0)
Requirement already satisfied: matplotlib in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from wordcloud==1.8.2.2) (3.7.1)
Requirement already satisfied: contourpy>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib->wordcloud==1.8.2.2) (1.0.6)
Requirement already satisfied: cycler>=0.10 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib->wordcloud==1.8.2.2) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib->wordcloud==1.8.2.2) (4.38.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib->wordcloud==1.8.2.2) (1.4.4)
Requirement already satisfied: packaging>=20.0 in /Users/jimmy/Library/Python/3.11/lib/python/site-packages (from matplotlib->wordcloud==1.8.2.2) (22.0)
Requirement already satisfied: pyparsing>=2.3.1 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from matplotlib->wordcloud==1.8.2.2) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in /Users/jimmy/Library/Python/3.11/lib/python/site-packages (from matplotlib->wordcloud==1.8.2.2) (2.8.2)
Requirement already satisfied: six>=1.5 in /Users/jimmy/Library/Python/3.11/lib/python/site-packages (from python-dateutil>=2.7->matplotlib->wordcloud==1.8.2.2) (1.16.0)
Installing collected packages: wordcloud
  DEPRECATION: wordcloud is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  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
      /Library/Frameworks/Python.framework/Versions/3.11/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 arm64 -arch x86_64 -g -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.

OS: Ventura 13.2.1 Python: 3.10.9 Wordcloud: 1.8.2.2

funmathis commented 1 year ago

I think this is actually a mac issue: https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a

wwwzwbz commented 1 year ago

I had the same issue, and I'm using a M1 mac. Changed my python version 3.9 worked fine for me

mjmare commented 1 year ago

Same here on M2 MBP. Reinstalling Xcode and reverting from python 3.11 to 3.9 did not solve the problem.

amueller commented 1 year ago

Can you please try again? Should be released now for 3.7, 3.8, 3.9, 3.10, 3.11

mjmare commented 1 year ago

Seems to work! Thanks.

amueller commented 1 year ago

great, thank you for checking!