Package install issue "error: legacy-install-failure" MacOS

I am getting the below error when trying to install wordcloud. I am using MacOs 13.0.1 and Python 3.8.10.

Jesse-Burton@MacBook-Pro-4 ~ % pip3 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 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from wordcloud) (1.23.4) Requirement already satisfied: pillow in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from wordcloud) (9.2.0) Requirement already satisfied: matplotlib in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from wordcloud) (3.6.0) Requirement already satisfied: python-dateutil>=2.7 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (2.8.2) Requirement already satisfied: cycler>=0.10 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (0.11.0) Requirement already satisfied: packaging>=20.0 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (21.3) Requirement already satisfied: fonttools>=4.22.0 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (4.38.0) Requirement already satisfied: contourpy>=1.0.1 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (1.0.5) Requirement already satisfied: pyparsing>=2.2.1 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (3.0.9) Requirement already satisfied: kiwisolver>=1.0.1 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from matplotlib->wordcloud) (1.4.4) Requirement already satisfied: six>=1.5 in ./.pyenv/versions/3.8.10/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib->wordcloud) (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 ╰─> [26 lines of output] running install /Users/Jesse-Burton/.pyenv/versions/3.8.10/lib/python3.8/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-12.6-arm64-cpython-38 creating build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/wordcloud_cli.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/_version.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/init.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/tokenization.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/wordcloud.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/color_from_image.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/main.py -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/stopwords -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud copying wordcloud/DroidSansMono.ttf -> build/lib.macosx-12.6-arm64-cpython-38/wordcloud UPDATING build/lib.macosx-12.6-arm64-cpython-38/wordcloud/_version.py set build/lib.macosx-12.6-arm64-cpython-38/wordcloud/_version.py to '1.8.2.2' running build_ext building 'wordcloud.query_integral_image' extension creating build/temp.macosx-12.6-arm64-cpython-38 creating build/temp.macosx-12.6-arm64-cpython-38/wordcloud clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Users/Jesse-Burton/.pyenv/versions/3.8.10/include/python3.8 -c wordcloud/query_integral_image.c -o build/temp.macosx-12.6-arm64-cpython-38/wordcloud/query_integral_image.o xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun 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 Matplotlib Pillow and Pandas all installed.

Any assistance would be greatly appreciated!

Upvotes: 1

Views: 3293

Answers (1)

So it turns out that I was getting this similar error on several packages, gensim being a core one.

I saw further up in the error message in the gensim install failure that it failed building the wheel and further down in that error message as well in this error message was this:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

I was able to remedy this by installing xCode developer tools. by running xcode-select --install

After doing that everything worked perfectly!

Upvotes: 1

Related Questions