PacktPublishing / LLM-Engineers-Handbook

The LLM's practical guide: From the fundamentals to deploying advanced LLM and RAG apps to AWS using LLMOps best practices
https://www.amazon.com/LLM-Engineers-Handbook-engineering-production/dp/1836200072/
MIT License
1.51k stars 236 forks source link

CalledProcessError and many installation errors #9

Closed itinance closed 3 weeks ago

itinance commented 3 weeks ago

When following the README instructions, it stops early while installing because of the inability to install a dependency called "packaging":

❯ poetry self add 'poethepoet[poetry_plugin]==0.29.0'

Updating dependencies
Resolving dependencies... (3.2s)

Package operations: 3 installs, 6 updates, 0 removals

  - Updating certifi (2024.8.30 /opt/homebrew/lib/python3.13/site-packages -> 2024.8.30)
  - Updating pycparser (2.22 /opt/homebrew/lib/python3.13/site-packages -> 2.22)
  - Updating cffi (1.17.1 /opt/homebrew/lib/python3.13/site-packages -> 1.17.1): Installing...
  - Updating packaging (24.1 /opt/homebrew/lib/python3.13/site-packages -> 24.1): Failed

  CalledProcessError

  Command '['/opt/homebrew/Cellar/poetry/1.8.4/libexec/bin/python', '/opt/homebrew/Cellar/poetry/1.8.4/libexec/lib/python3.13/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip', 'uninstall', 'packaging', '-y']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py:577 in run
       573│             # We don't call process.wait() as .__exit__ does that for us.
       574│             raise
       575│         retcode = process.poll()
       576│         if check and retcode:
    →  577│             raise CalledProcessError(retcode, process.args,
       578│                                      output=stdout, stderr=stderr)
       579│     return CompletedProcess(process.args, retcode, stdout, stderr)
       580│
       581│

The following error occurred when trying to handle this error:

  EnvCommandError

  - Updating packaging (24.1 /opt/homebrew/lib/python3.13/site-packages -> 24.1): Failed

  CalledProcessError

  Command '['/opt/homebrew/Cellar/poetry/1.8.4/libexec/bin/python', '/opt/homebrew/Cellar/poetry/1.8.4/libexec/lib/python3.13/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip', 'uninstall', 'packaging', '-y']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py:577 in run
       573│             # We don't call process.wait() as .__exit__ does that for us.
       574│             raise
       575│         retcode = process.poll()
       576│         if check and retcode:
    →  577│             raise CalledProcessError(retcode, process.args,
       578│                                      output=stdout, stderr=stderr)
       579│     return CompletedProcess(process.args, retcode, stdout, stderr)
       580│
       581│

The following error occurred when trying to handle this error:

  EnvCommandError

  - Updating cffi (1.17.1 /opt/homebrew/lib/python3.13/site-packages -> 1.17.1)
  - Updating packaging (24.1 /opt/homebrew/lib/python3.13/site-packages -> 24.1): Failed

  CalledProcessError

  Command '['/opt/homebrew/Cellar/poetry/1.8.4/libexec/bin/python', '/opt/homebrew/Cellar/poetry/1.8.4/libexec/lib/python3.13/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip', 'uninstall', 'packaging', '-y']' returned non-zero exit status 1.

  at /opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py:577 in run
       573│             # We don't call process.wait() as .__exit__ does that for us.
       574│             raise
       575│         retcode = process.poll()
       576│         if check and retcode:
    →  577│             raise CalledProcessError(retcode, process.args,
       578│                                      output=stdout, stderr=stderr)
       579│     return CompletedProcess(process.args, retcode, stdout, stderr)
       580│
       581│

The following error occurred when trying to handle this error:

  EnvCommandError

  Command ['/opt/homebrew/Cellar/poetry/1.8.4/libexec/bin/python', '/opt/homebrew/Cellar/poetry/1.8.4/libexec/lib/python3.13/site-packages/virtualenv/seed/wheels/embed/pip-24.2-py3-none-any.whl/pip', 'uninstall', 'packaging', '-y'] errored with the following return code 1

  Output:
  Found existing installation: packaging 24.1
  error: uninstall-no-record-file

  × Cannot uninstall packaging 24.1
  ╰─> The package's contents are unknown: no RECORD file was found for packaging.

  hint: The package was installed by brew. You should check if it can uninstall the package.

  at /opt/homebrew/Cellar/poetry/1.8.4/libexec/lib/python3.13/site-packages/poetry/utils/env/base_env.py:342 in _run
      338│                 output = subprocess.check_output(
      339│                     cmd, stderr=stderr, env=env, text=True, **kwargs
      340│                 )
      341│         except CalledProcessError as e:
    → 342│             raise EnvCommandError(e)
      343│
      344│         return output
      345│
      346│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

Cannot install packaging.
iusztinpaul commented 3 weeks ago

You have to use python 3.11 as explain here: https://github.com/PacktPublishing/LLM-Engineers-Handbook?tab=readme-ov-file#install-python-311-using-pyenv-optional

iusztinpaul commented 3 weeks ago

Let me know if this helps.