chatgpt-retrieval-plugin
chatgpt-retrieval-plugin copied to clipboard
Getting error while following docker build stage
When I was using the source code to perform a docker build, I encountered the following error:
#12 69.55 × Building wheel for tiktoken (pyproject.toml) did not run successfully.
#12 69.55 │ exit code: 1
#12 69.55 ╰─> [37 lines of output]
#12 69.55 running bdist_wheel
#12 69.55 running build
#12 69.55 running build_py
#12 69.55 creating build
#12 69.55 creating build/lib.linux-aarch64-cpython-310
#12 69.55 creating build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 copying tiktoken/core.py -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 copying tiktoken/model.py -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 copying tiktoken/init.py -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 copying tiktoken/load.py -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 copying tiktoken/registry.py -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 creating build/lib.linux-aarch64-cpython-310/tiktoken_ext
#12 69.55 copying tiktoken_ext/openai_public.py -> build/lib.linux-aarch64-cpython-310/tiktoken_ext
#12 69.55 running egg_info
#12 69.55 writing tiktoken.egg-info/PKG-INFO
#12 69.55 writing dependency_links to tiktoken.egg-info/dependency_links.txt
#12 69.55 writing requirements to tiktoken.egg-info/requires.txt
#12 69.55 writing top-level names to tiktoken.egg-info/top_level.txt
#12 69.55 reading manifest file 'tiktoken.egg-info/SOURCES.txt'
#12 69.55 reading manifest template 'MANIFEST.in'
#12 69.55 warning: no files found matching 'Makefile'
#12 69.55 adding license file 'LICENSE'
#12 69.55 writing manifest file 'tiktoken.egg-info/SOURCES.txt'
#12 69.55 copying tiktoken/py.typed -> build/lib.linux-aarch64-cpython-310/tiktoken
#12 69.55 running build_ext
#12 69.55 running build_rust
#12 69.55 error: can't find Rust compiler
#12 69.55
#12 69.55 If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
#12 69.55
#12 69.55 To update pip, run:
#12 69.55
#12 69.55 pip install --upgrade pip
#12 69.55
#12 69.55 and then retry package installation.
#12 69.55
#12 69.55 If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
#12 69.55 [end of output]
#12 69.55
#12 69.55 note: This error originates from a subprocess, and is likely not a problem with pip.
#12 69.55 ERROR: Failed building wheel for tiktoken
#12 69.55 Building wheel for validators (setup.py): started
#12 69.72 Building wheel for validators (setup.py): finished with status 'done'
#12 69.72 Created wheel for validators: filename=validators-0.19.0-py3-none-any.whl size=19550 sha256=3ca386640a9de528da927813ac8cee04029742b5591bf455392b0e3f2d04f125
#12 69.72 Stored in directory: /tmp/pip-ephem-wheel-cache-debhuwgt/wheels/a6/73/25/eebd6c1919ec8160e4f0c083d6ef90b0de69182d17196b9c12
#12 69.72 Successfully built docx2txt mmh3 python-pptx validators
#12 69.72 Failed to build tiktoken
#12 69.72 ERROR: Could not build wheels for tiktoken, which is required to install pyproject.toml-based projects
#12 70.39
#12 70.39 [notice] A new release of pip available: 22.3.1 -> 23.0.1
#12 70.39 [notice] To update, run: pip install --upgrade pip
executor failed running [/bin/sh -c pip install --no-cache-dir --upgrade -r /code/requirements.txt]: exit code: 1
How can I solve this problem?
Solved this problem here with 2 steps.
first adding a command to upgrade the pip on docker file.
RUN apt-get update
RUN pip install --upgrade pip
then installing the rust and restarting the shell for solve some cargo issue.
RUN apt-get install -y gcc curl
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
SHELL ["bash", "-lc"]