句子块库未被安装在系统中。

13
在使用 pip install tf-models-official 安装库时我遇到了以下问题:
Collecting tf-models-official
  Using cached tf_models_official-2.8.0-py2.py3-none-any.whl (2.2 MB)
Requirement already satisfied: Pillow in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (9.0.1)
Collecting gin-config
  Using cached gin_config-0.5.0-py3-none-any.whl (61 kB)
Collecting seqeval
  Using cached seqeval-1.2.2-py3-none-any.whl
Requirement already satisfied: tensorflow~=2.8.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (2.8.0)
Collecting tensorflow-datasets
  Using cached tensorflow_datasets-4.5.2-py3-none-any.whl (4.2 MB)
Requirement already satisfied: six in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (1.16.0)
Requirement already satisfied: scipy>=0.19.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (1.8.0)
Collecting pandas>=0.22.0
  Using cached pandas-1.4.1-cp310-cp310-win_amd64.whl (10.6 MB)
Collecting py-cpuinfo>=3.3.0
  Using cached py_cpuinfo-8.0.0-py3-none-any.whl
Collecting google-api-python-client>=1.6.7
  Downloading google_api_python_client-2.42.0-py2.py3-none-any.whl (8.3 MB)
     ---------------------------------------- 8.3/8.3 MB 7.6 MB/s eta 0:00:00
Requirement already satisfied: tf-slim>=1.1.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (1.1.0)
Requirement already satisfied: psutil>=5.4.3 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (5.9.0)
Collecting tensorflow-hub>=0.6.0
  Using cached tensorflow_hub-0.12.0-py2.py3-none-any.whl (108 kB)
Requirement already satisfied: matplotlib in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (3.5.1)
Collecting kaggle>=1.3.9
  Using cached kaggle-1.5.12-py3-none-any.whl
Collecting sacrebleu
  Using cached sacrebleu-2.0.0-py3-none-any.whl (90 kB)
Requirement already satisfied: numpy>=1.15.4 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (1.22.3)
Collecting tensorflow-addons
  Using cached tensorflow_addons-0.16.1-cp310-cp310-win_amd64.whl (755 kB)
Collecting oauth2client
  Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
Collecting pyyaml<6.0,>=5.1
  Using cached PyYAML-5.4.1-cp310-cp310-win_amd64.whl
Collecting sentencepiece
  Using cached sentencepiece-0.1.96.tar.gz (508 kB)
  Preparing metadata (setup.py) ... done
Collecting opencv-python-headless
  Using cached opencv_python_headless-4.5.5.64-cp36-abi3-win_amd64.whl (35.3 MB)
Requirement already satisfied: Cython in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (0.29.28)
Requirement already satisfied: pycocotools in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tf-models-official) (2.0.4)
Collecting tensorflow-text~=2.8.0
  Using cached tensorflow_text-2.8.1-cp310-cp310-win_amd64.whl (2.5 MB)
Collecting tensorflow-model-optimization>=0.4.1
  Using cached tensorflow_model_optimization-0.7.2-py2.py3-none-any.whl (237 kB)
Requirement already satisfied: google-auth<3.0.0dev,>=1.16.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from google-api-python-client>=1.6.7->tf-models-official) (2.6.2)
Collecting google-api-core!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5
  Using cached google_api_core-2.7.1-py3-none-any.whl (114 kB)
Collecting uritemplate<5,>=3.0.1
  Using cached uritemplate-4.1.1-py2.py3-none-any.whl (10 kB)
Collecting google-auth-httplib2>=0.1.0
  Using cached google_auth_httplib2-0.1.0-py2.py3-none-any.whl (9.3 kB)
Collecting httplib2<1dev,>=0.15.0
  Using cached httplib2-0.20.4-py3-none-any.whl (96 kB)
Requirement already satisfied: tqdm in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from kaggle>=1.3.9->tf-models-official) (4.63.0)
Requirement already satisfied: urllib3 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from kaggle>=1.3.9->tf-models-official) (1.26.9)
Collecting python-slugify
  Using cached python_slugify-6.1.1-py2.py3-none-any.whl (9.1 kB)
Requirement already satisfied: python-dateutil in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from kaggle>=1.3.9->tf-models-official) (2.8.2)
Requirement already satisfied: requests in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from kaggle>=1.3.9->tf-models-official) (2.27.1)
Requirement already satisfied: certifi in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from kaggle>=1.3.9->tf-models-official) (2021.10.8)
Collecting pytz>=2020.1
  Using cached pytz-2022.1-py2.py3-none-any.whl (503 kB)
Requirement already satisfied: h5py>=2.9.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (3.6.0)
Requirement already satisfied: setuptools in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (58.1.0)
Requirement already satisfied: gast>=0.2.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (0.5.3)
Requirement already satisfied: flatbuffers>=1.12 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (2.0)
Requirement already satisfied: libclang>=9.0.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (13.0.0)
Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (0.24.0)
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (3.3.0)
Requirement already satisfied: protobuf>=3.9.2 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (3.19.4)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.44.0)
Requirement already satisfied: keras-preprocessing>=1.1.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.1.2)
Requirement already satisfied: absl-py>=0.4.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.0.0)
Requirement already satisfied: wrapt>=1.11.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.14.0)
Requirement already satisfied: keras<2.9,>=2.8.0rc0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (2.8.0)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.1.0)
Requirement already satisfied: google-pasta>=0.1.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (0.2.0)
Requirement already satisfied: astunparse>=1.6.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (1.6.3)
Requirement already satisfied: tf-estimator-nightly==2.8.0.dev2021122109 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (2.8.0.dev2021122109)
Requirement already satisfied: tensorboard<2.9,>=2.8 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (2.8.0)
Requirement already satisfied: typing-extensions>=3.6.6 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorflow~=2.8.0->tf-models-official) (4.1.1)
Collecting dm-tree~=0.1.1
  Using cached dm_tree-0.1.6-cp310-cp310-win_amd64.whl (91 kB)
Requirement already satisfied: pyparsing>=2.2.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from matplotlib->tf-models-official) (3.0.7)
Requirement already satisfied: cycler>=0.10 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from matplotlib->tf-models-official) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from matplotlib->tf-models-official) (1.4.0)
Requirement already satisfied: packaging>=20.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from matplotlib->tf-models-official) (21.3)
Requirement already satisfied: fonttools>=4.22.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from matplotlib->tf-models-official) (4.31.1)
Requirement already satisfied: pyasn1-modules>=0.0.5 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from oauth2client->tf-models-official) (0.2.8)
Requirement already satisfied: rsa>=3.1.4 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from oauth2client->tf-models-official) (4.8)
Requirement already satisfied: pyasn1>=0.1.7 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from oauth2client->tf-models-official) (0.4.8)
Requirement already satisfied: tabulate>=0.8.9 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from sacrebleu->tf-models-official) (0.8.9)
Collecting regex
  Using cached regex-2022.3.15-cp310-cp310-win_amd64.whl (274 kB)
Requirement already satisfied: colorama in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from sacrebleu->tf-models-official) (0.4.4)
Collecting portalocker
  Using cached portalocker-2.4.0-py2.py3-none-any.whl (16 kB)
Collecting scikit-learn>=0.21.3
  Using cached scikit_learn-1.0.2-cp310-cp310-win_amd64.whl (7.2 MB)
Collecting typeguard>=2.7
  Using cached typeguard-2.13.3-py3-none-any.whl (17 kB)
Collecting dill
  Using cached dill-0.3.4-py2.py3-none-any.whl (86 kB)
Collecting promise
  Using cached promise-2.3-py3-none-any.whl
Collecting tensorflow-metadata
  Using cached tensorflow_metadata-1.7.0-py3-none-any.whl (48 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from astunparse>=1.6.0->tensorflow~=2.8.0->tf-models-official) (0.37.1)
Collecting googleapis-common-protos<2.0dev,>=1.52.0
  Using cached googleapis_common_protos-1.56.0-py2.py3-none-any.whl (241 kB)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from google-auth<3.0.0dev,>=1.16.0->google-api-python-client>=1.6.7->tf-models-official) (5.0.0)
Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from requests->kaggle>=1.3.9->tf-models-official) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from requests->kaggle>=1.3.9->tf-models-official) (3.3)
Collecting threadpoolctl>=2.0.0
  Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting joblib>=0.11
  Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (0.6.1)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (1.8.1)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (2.0.3)
Requirement already satisfied: markdown>=2.6.8 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (3.3.6)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (0.4.6)
Requirement already satisfied: pywin32>=226 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from portalocker->sacrebleu->tf-models-official) (303)
Requirement already satisfied: text-unidecode>=1.3 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from python-slugify->kaggle>=1.3.9->tf-models-official) (1.3)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (1.3.1)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.9,>=2.8->tensorflow~=2.8.0->tf-models-official) (3.2.0)
Building wheels for collected packages: sentencepiece
  Building wheel for sentencepiece (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      C:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\lib\site-packages\setuptools\dist.py:717: 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 bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/__init__.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_model_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      running build_ext
      building 'sentencepiece._sentencepiece' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      creating build\temp.win-amd64-3.10\Release\src\sentencepiece
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /EHsc /Tpsrc/sentencepiece/sentencepiece_wrap.cxx /Fobuild\temp.win-amd64-3.10\Release\src/sentencepiece/sentencepiece_wrap.obj /MT /I..\build\root\include
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      sentencepiece_wrap.cxx
      src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  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
Failed to build sentencepiece
Installing collected packages: sentencepiece, pytz, py-cpuinfo, gin-config, dm-tree, uritemplate, typeguard, threadpoolctl, tensorflow-model-optimization, tensorflow-hub, regex, pyyaml, python-slugify, promise, portalocker, opencv-python-headless, joblib, httplib2, googleapis-common-protos, dill, tensorflow-metadata, tensorflow-addons, scikit-learn, sacrebleu, pandas, oauth2client, kaggle, tensorflow-datasets, seqeval, google-auth-httplib2, google-api-core, google-api-python-client, tensorflow-text, tf-models-official
  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
  ╰─> [22 lines of output]
      C:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\lib\site-packages\setuptools\dist.py:717: 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
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/__init__.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_model_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      running build_ext
      building 'sentencepiece._sentencepiece' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      creating build\temp.win-amd64-3.10\Release\src\sentencepiece
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /EHsc /Tpsrc/sentencepiece/sentencepiece_wrap.cxx /Fobuild\temp.win-amd64-3.10\Release\src/sentencepiece/sentencepiece_wrap.obj /MT /I..\build\root\include
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      sentencepiece_wrap.cxx
      src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [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.
╰─> sentencepiece 

因此,我认为问题可能出在SentencePiece上。尝试使用两个命令pip install sentencepiecepip install sentencepiece==0.1.92安装SentencePiece。但是出现了以下错误:
   Collecting sentencepiece
  Using cached sentencepiece-0.1.96.tar.gz (508 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: sentencepiece
  Building wheel for sentencepiece (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      C:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\lib\site-packages\setuptools\dist.py:717: 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 bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/__init__.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_model_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      running build_ext
      building 'sentencepiece._sentencepiece' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      creating build\temp.win-amd64-3.10\Release\src\sentencepiece
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /EHsc /Tpsrc/sentencepiece/sentencepiece_wrap.cxx /Fobuild\temp.win-amd64-3.10\Release\src/sentencepiece/sentencepiece_wrap.obj /MT /I..\build\root\include
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      sentencepiece_wrap.cxx
      src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  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
Failed to build sentencepiece
Installing collected packages: sentencepiece
  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
  ╰─> [22 lines of output]
      C:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\lib\site-packages\setuptools\dist.py:717: 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
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-3.10
      creating build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/__init__.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_model_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      copying src\sentencepiece/sentencepiece_pb2.py -> build\lib.win-amd64-3.10\sentencepiece
      running build_ext
      building 'sentencepiece._sentencepiece' extension
      creating build\temp.win-amd64-3.10
      creating build\temp.win-amd64-3.10\Release
      creating build\temp.win-amd64-3.10\Release\src
      creating build\temp.win-amd64-3.10\Release\src\sentencepiece
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\USER\Documents\Python Scripts\Number_Plate_Recognition\anprsys\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\include -IC:\Users\USER\AppData\Local\Programs\Python\Python310\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt /EHsc /Tpsrc/sentencepiece/sentencepiece_wrap.cxx /Fobuild\temp.win-amd64-3.10\Release\src/sentencepiece/sentencepiece_wrap.obj /MT /I..\build\root\include
      cl : Command line warning D9025 : overriding '/MD' with '/MT'
      sentencepiece_wrap.cxx
      src/sentencepiece/sentencepiece_wrap.cxx(2809): fatal error C1083: Cannot open include file: 'sentencepiece_processor.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [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.
╰─> sentencepiece

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

我已经尝试通过 pip install wheels 来查看是否安装了 wheels。

Requirement already satisfied: wheel in c:\users\user\documents\python scripts\number_plate_recognition\anprsys\lib\site-packages (0.37.1)

我已经努力寻找解决方案,但一直未能成功。

1个回答

10

sentencepiece 是一个需要二进制扩展的库,因此必须为每个操作系统、CPU架构和Python版本打包单独的wheel。从上面的日志中看来,你正在使用 Windows AMD64 上的 CPython 3.10。查看 pypi上可用的wheels,目前还没有适用于这个平台的wheel。只有 Python 版本在3.6到3.9之间的Windows wheel。

这意味着你必须要么降级到Python 3.9,要么从源代码构建sentencepiece


2
更新:现在他们为 Windows 提供 Python 3.10 版的轮子。但是,截至2023年4月1日,Python 3.11 版的轮子还未适用于任何平台。 - mara004
2
谢谢!v3.11整天都在抛出错误。 - Dipo

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接