xueguhanyu 2022-12-02 07:29 采纳率: 33.3%
浏览 1300

python安装第三方库:cchardet 失败

python 安装第三方库弹出如下错误,在网络上找了很多方法都没有解决。

C:\Users\EDY>pip install cchardet
Collecting cchardet
  Using cached cchardet-2.1.7.tar.gz (653 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: cchardet
  Building wheel for cchardet (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\cchardet
      copying src\cchardet\version.py -> build\lib.win-amd64-cpython-311\cchardet
      copying src\cchardet\__init__.py -> build\lib.win-amd64-cpython-311\cchardet
      running build_ext
      building 'cchardet._cchardet' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      creating build\temp.win-amd64-cpython-311\Release\src\cchardet
      creating build\temp.win-amd64-cpython-311\Release\src\ext
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src\LangModels
      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isrc/ext/uchardet/src -IC:\Users\EDY\AppData\Local\Programs\Python\Python311\include -IC:\Users\EDY\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc/cchardet\_cchardet.cpp /Fobuild\temp.win-amd64-cpython-311\Release\src/cchardet\_cchardet.obj
      _cchardet.cpp
      src/cchardet\_cchardet.cpp(196): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\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 cchardet
  Running setup.py clean for cchardet
Failed to build cchardet
Installing collected packages: cchardet
  Running setup.py install for cchardet ... error
  error: subprocess-exited-with-error

  × Running setup.py install for cchardet did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      running install
      C:\Users\EDY\AppData\Local\Programs\Python\Python311\Lib\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.win-amd64-cpython-311
      creating build\lib.win-amd64-cpython-311\cchardet
      copying src\cchardet\version.py -> build\lib.win-amd64-cpython-311\cchardet
      copying src\cchardet\__init__.py -> build\lib.win-amd64-cpython-311\cchardet
      running build_ext
      building 'cchardet._cchardet' extension
      creating build\temp.win-amd64-cpython-311
      creating build\temp.win-amd64-cpython-311\Release
      creating build\temp.win-amd64-cpython-311\Release\src
      creating build\temp.win-amd64-cpython-311\Release\src\cchardet
      creating build\temp.win-amd64-cpython-311\Release\src\ext
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src
      creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src\LangModels
      "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isrc/ext/uchardet/src -IC:\Users\EDY\AppData\Local\Programs\Python\Python311\include -IC:\Users\EDY\AppData\Local\Programs\Python\Python311\Include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpsrc/cchardet\_cchardet.cpp /Fobuild\temp.win-amd64-cpython-311\Release\src/cchardet\_cchardet.obj
      _cchardet.cpp
      src/cchardet\_cchardet.cpp(196): fatal error C1083: Cannot open include file: 'longintrepr.h': No such file or directory
      error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\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.
╰─> cchardet

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

展开全部

  • 写回答

2条回答 默认 最新

  • while True:study() 2023-07-30 14:30
    关注

    python版本太高了

    评论
  • Ding Jiaxiong 全栈领域新星创作者 2022-12-02 07:36
    关注

    img

    加上清华源 试试,pip install cchardet -i https://pypi.tuna.tsinghua.edu.cn/simple

    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部