$ pip install --upgrade setuptools Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (49.2.1) Collecting setuptools Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB) Installing collected packages: setuptools Successfully installed setuptools-62.1.0
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for sentencepiece Running setup.py clean for sentencepiece Building wheel for grpcio (setup.py) ... done Created wheel for grpcio: filename=grpcio-1.45.0-cp38-cp38-macosx_10_14_arm64.whl size=7451816 sha256=5909c0fc7f0fc6fe959b5205d8fb6293404e377b651fb97aeaaf3574a8c528a0 Stored in directory: /Users/gavin/Library/Caches/pip/wheels/bb/fe/aa/509208bd9420844c88b4a73ced4bc58f069a3db3b3a4b23336 Successfully built grpcio Failed to build tokenizers sentencepiece ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
解决方案,安装 rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Running setup.py install for sentencepiece ... error error: subprocess-exited-with-error
× Running setup.py install for sentencepiece did not run successfully. │ exit code: 1 ╰─> [25 lines of output] /Users/gavin/Library/Python/3.8/lib/python/site-packages/setuptools/dist.py:757: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead warnings.warn( running install /Users/gavin/Library/Python/3.8/lib/python/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.14-arm64-cpython-38 creating build/lib.macosx-10.14-arm64-cpython-38/sentencepiece copying src/sentencepiece/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/sentencepiece copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-10.14-arm64-cpython-38/sentencepiece copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-10.14-arm64-cpython-38/sentencepiece running build_ext /bin/sh: pkg-config: command not found mkdir: bundled: File exists fatal: destination path 'sentencepiece' already exists and is not an empty directory. fatal: destination path 'sentencepiece' already exists and is not an empty directory. mkdir: build: File exists ./build_bundled.sh: line 15: cmake: command not found ./build_bundled.sh: line 16: nproc: command not found make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target `install'. Stop. env: pkg-config: No such file or directory Failed to find sentencepiece pkg-config [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure