Python --version에는 버전 3.10.8이 표시되지만, Whisper를 설치할 때 버전이 3.11.2라는 오류가 발생합니다.

Python --version에는 버전 3.10.8이 표시되지만, Whisper를 설치할 때 버전이 3.11.2라는 오류가 발생합니다.

그래서 OpenAI에서 Whisper를 설치하려고 하는데 버전이 있어서 3.11.2설치할 수 없다고 나오네요. 단지 Whisper 버전이 필요 >=3.7,<3.11 하지만 Python 버전을 확인하면 다음과 같이 필요한 버전이 있다고 나옵니다.

$ python --version                                      
Python 3.10.8

그런데, 버전이 있기 전에는 3.11.2다음의 도움으로 버전을 변경했습니다.이 게시물
어쩌면 이 게시물의 명령을 실행하는 것이 도움이 되지 않을 수도 있습니다. 저는 완전 초보자이기 때문에 제가 모르는 간단한 해결책이 있을 수도 있습니다. 저도 칼리리눅스를 사용하고 있습니다.
내가 겪은 오류는 다음과 같습니다.

pip install git+https://github.com/openai/whisper.git 
    Defaulting to user installation because normal site-packages is not writeable
    Collecting git+https://github.com/openai/whisper.git
      Cloning https://github.com/openai/whisper.git to /tmp/pip-req-build-n6ajw2le
      Running command git clone --filter=blob:none --quiet https://github.com/openai/whisper.git /tmp/pip-req-build-n6ajw2le
      Resolved https://github.com/openai/whisper.git to commit ad3250a846fe7553a25064a2dc593e492dadf040
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting triton==2.0.0
      Using cached triton-2.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (63.3 MB)
    Collecting numba
      Using cached numba-0.56.4.tar.gz (2.4 MB)
      Preparing metadata (setup.py) ... error
      error: subprocess-exited-with-error
      
      × python setup.py egg_info did not run successfully.
      │ exit code: 1
      ╰─> [8 lines of output]
          Traceback (most recent call last):
            File "<string>", line 2, in <module>
            File "<pip-setuptools-caller>", line 34, in <module>
            File "/tmp/pip-install-bvqf8ryy/numba_26a7eac980d84443948e159a452af5d2/setup.py", line 51, in <module>
              _guard_py_ver()
            File "/tmp/pip-install-bvqf8ryy/numba_26a7eac980d84443948e159a452af5d2/setup.py", line 48, in _guard_py_ver
              raise RuntimeError(msg.format(cur_py, min_py, max_py))
          RuntimeError: Cannot install on Python version 3.11.2; only versions >=3.7,<3.11 are supported.
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
    error: metadata-generation-failed
    
    × Encountered error while generating package metadata.
    ╰─> See above for output.
    
    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.

답변1

문제 update-alternatives는 아직 다른 버전이 설치되어 있고, 사용 중인 프로그램이 반드시 원하는 버전을 사용할 필요는 없다는 점입니다. 를 사용하여 불필요한 패키지를 제거해 보세요 apt purge.

또한 남겨진 Python 관련 정크를 검토 ~/.local/bin하고 ~/.local/lib삭제하세요 . pip이 폴더에 다른 항목이 설치되어 있지 않으면 삭제해도 안전합니다. 경고: ~/.local/share보관하려는 파일이 포함되어 있습니다. 청소를 원할 경우 수동으로 청소해야 합니다.

pip캐시 다운로드를 통해 ~/.cache/pip대부분의 패키지를 다시 다운로드할 필요 없이 패키지를 다시 설치할 수 있습니다.

관련 정보