Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1 #422

Open
praful1609 opened this issue Nov 27, 2023 · 16 comments

Comments

@praful1609
Copy link

I am working on ML project, while creating a docker image i'm facing this error

@praful1609
Copy link
Author

=> ERROR [4/4] RUN pip install --no-cache-dir -r requirements.txt 63.7s

[4/4] RUN pip install --no-cache-dir -r requirements.txt:
3.681 Obtaining file:///app (from -r requirements.txt (line 15))
3.686 Preparing metadata (setup.py): started
4.168 Preparing metadata (setup.py): finished with status 'done'
4.929 Collecting numpy
6.078 Downloading numpy-1.26.2-cp39-cp39-musllinux_1_1_x86_64.whl (18.1 MB)
14.27 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.1/18.1 MB 2.4 MB/s eta 0:00:00
14.55 Collecting pandas
14.57 Downloading pandas-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl (13.2 MB)
19.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.2/13.2 MB 2.4 MB/s eta 0:00:00
20.17 Collecting scikit-learn
20.19 Downloading scikit-learn-1.3.2.tar.gz (7.5 MB)
23.25 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 MB 2.5 MB/s eta 0:00:00
24.16 Installing build dependencies: started
62.65 Installing build dependencies: finished with status 'error'
62.68 error: subprocess-exited-with-error
62.68
62.68 × pip subprocess to install build dependencies did not run successfully.
62.68 │ exit code: 1
62.68 ╰─> [270 lines of output]
62.68 Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
62.68 Collecting setuptools
62.68 Downloading setuptools-69.0.2-py3-none-any.whl (819 kB)
62.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 819.5/819.5 kB 2.4 MB/s eta 0:00:00
62.68 Collecting wheel
62.68 Downloading wheel-0.42.0-py3-none-any.whl (65 kB)
62.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.4/65.4 kB 2.5 MB/s eta 0:00:00
62.68 Collecting Cython<3.0,>=0.29.33
62.68 Downloading Cython-0.29.36-cp39-cp39-musllinux_1_1_x86_64.whl (2.0 MB)
62.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 2.4 MB/s eta 0:00:00
62.68 Collecting oldest-supported-numpy
62.68 Downloading oldest_supported_numpy-2023.10.25-py3-none-any.whl (4.9 kB)
62.68 Collecting scipy>=1.5.0
62.68 Downloading scipy-1.11.4-cp39-cp39-musllinux_1_1_x86_64.whl (36.8 MB)
62.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36.8/36.8 MB 2.3 MB/s eta 0:00:00
62.68 Collecting numpy==1.19.3
62.68 Downloading numpy-1.19.3.zip (7.3 MB)
62.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.3/7.3 MB 2.4 MB/s eta 0:00:00
62.68 Installing build dependencies: started
62.68 Installing build dependencies: finished with status 'done'
62.68 Getting requirements to build wheel: started
62.68 Getting requirements to build wheel: finished with status 'done'
62.68 Preparing metadata (pyproject.toml): started
62.68 Preparing metadata (pyproject.toml): finished with status 'error'
62.68 error: subprocess-exited-with-error
62.68
62.68 × Preparing metadata (pyproject.toml) did not run successfully.
62.68 │ exit code: 1
62.68 ╰─> [228 lines of output]
62.68 Running from numpy source directory.
62.68 setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
62.68 run_build = parse_setuppy_commands()
62.68 Processing numpy/random/_bounded_integers.pxd.in
62.68 Processing numpy/random/_pcg64.pyx
62.68 Processing numpy/random/_generator.pyx
62.68 Processing numpy/random/_sfc64.pyx
62.68 Processing numpy/random/_philox.pyx
62.68 Processing numpy/random/_mt19937.pyx
62.68 Processing numpy/random/bit_generator.pyx
62.68 Processing numpy/random/_bounded_integers.pyx.in
62.68 Processing numpy/random/_common.pyx
62.68 Processing numpy/random/mtrand.pyx
62.68 Cythonizing sources
62.68 blas_opt_info:
62.68 blas_mkl_info:
62.68 customize UnixCCompiler
62.68 libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 blis_info:
62.68 libraries blis not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 openblas_info:
62.68 libraries openblas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 atlas_3_10_blas_threads_info:
62.68 Setting PTATLAS=ATLAS
62.68 libraries tatlas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 atlas_3_10_blas_info:
62.68 libraries satlas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 atlas_blas_threads_info:
62.68 Setting PTATLAS=ATLAS
62.68 libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 atlas_blas_info:
62.68 libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 accelerate_info:
62.68 NOT AVAILABLE
62.68
62.68 /tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/system_info.py:1914: UserWarning:
62.68 Optimized (vendor) Blas libraries are not found.
62.68 Falls back to netlib Blas library which has worse performance.
62.68 A better performance should be easily gained by switching
62.68 Blas library.
62.68 if self._calc_info(blas):
62.68 blas_info:
62.68 libraries blas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 /tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/system_info.py:1914: UserWarning:
62.68 Blas (http://www.netlib.org/blas/) libraries not found.
62.68 Directories to search for the libraries can be specified in the
62.68 numpy/distutils/site.cfg file (section [blas]) or by setting
62.68 the BLAS environment variable.
62.68 if self._calc_info(blas):
62.68 blas_src_info:
62.68 NOT AVAILABLE
62.68
62.68 /tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/system_info.py:1914: UserWarning:
62.68 Blas (http://www.netlib.org/blas/) sources not found.
62.68 Directories to search for the sources can be specified in the
62.68 numpy/distutils/site.cfg file (section [blas_src]) or by setting
62.68 the BLAS_SRC environment variable.
62.68 if self.calc_info(blas):
62.68 NOT AVAILABLE
62.68
62.68 non-existing path in 'numpy/distutils': 'site.cfg'
62.68 lapack_opt_info:
62.68 lapack_mkl_info:
62.68 libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 openblas_lapack_info:
62.68 libraries openblas not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 openblas_clapack_info:
62.68 libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 flame_info:
62.68 libraries flame not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 atlas_3_10_threads_info:
62.68 Setting PTATLAS=ATLAS
62.68 libraries lapack_atlas not found in /usr/local/lib
62.68 libraries tatlas,tatlas not found in /usr/local/lib
62.68 libraries lapack_atlas not found in /usr/lib
62.68 libraries tatlas,tatlas not found in /usr/lib
62.68 <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
62.68 NOT AVAILABLE
62.68
62.68 atlas_3_10_info:
62.68 libraries lapack_atlas not found in /usr/local/lib
62.68 libraries satlas,satlas not found in /usr/local/lib
62.68 libraries lapack_atlas not found in /usr/lib
62.68 libraries satlas,satlas not found in /usr/lib
62.68 <class 'numpy.distutils.system_info.atlas_3_10_info'>
62.68 NOT AVAILABLE
62.68
62.68 atlas_threads_info:
62.68 Setting PTATLAS=ATLAS
62.68 libraries lapack_atlas not found in /usr/local/lib
62.68 libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
62.68 libraries lapack_atlas not found in /usr/lib
62.68 libraries ptf77blas,ptcblas,atlas not found in /usr/lib
62.68 <class 'numpy.distutils.system_info.atlas_threads_info'>
62.68 NOT AVAILABLE
62.68
62.68 atlas_info:
62.68 libraries lapack_atlas not found in /usr/local/lib
62.68 libraries f77blas,cblas,atlas not found in /usr/local/lib
62.68 libraries lapack_atlas not found in /usr/lib
62.68 libraries f77blas,cblas,atlas not found in /usr/lib
62.68 <class 'numpy.distutils.system_info.atlas_info'>
62.68 NOT AVAILABLE
62.68
62.68 lapack_info:
62.68 libraries lapack not found in ['/usr/local/lib', '/usr/lib']
62.68 NOT AVAILABLE
62.68
62.68 /tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/system_info.py:1748: UserWarning:
62.68 Lapack (http://www.netlib.org/lapack/) libraries not found.
62.68 Directories to search for the libraries can be specified in the
62.68 numpy/distutils/site.cfg file (section [lapack]) or by setting
62.68 the LAPACK environment variable.
62.68 return getattr(self, 'calc_info{}'.format(name))()
62.68 lapack_src_info:
62.68 NOT AVAILABLE
62.68
62.68 /tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/system_info.py:1748: UserWarning:
62.68 Lapack (http://www.netlib.org/lapack/) sources not found.
62.68 Directories to search for the sources can be specified in the
62.68 numpy/distutils/site.cfg file (section [lapack_src]) or by setting
62.68 the LAPACK_SRC environment variable.
62.68 return getattr(self, 'calc_info{}'.format(name))()
62.68 NOT AVAILABLE
62.68
62.68 numpy_linalg_lapack_lite:
62.68 FOUND:
62.68 language = c
62.68 define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64
')]
62.68
62.68 /usr/local/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
62.68 warnings.warn(msg)
62.68 running dist_info
62.68 running build_src
62.68 build_src
62.68 building py_modules sources
62.68 creating build
62.68 creating build/src.linux-x86_64-3.9
62.68 creating build/src.linux-x86_64-3.9/numpy
62.68 creating build/src.linux-x86_64-3.9/numpy/distutils
62.68 building library "npymath" sources
62.68 Could not locate executable gfortran
62.68 Could not locate executable f95
62.68 Could not locate executable ifort
62.68 Could not locate executable ifc
62.68 Could not locate executable lf95
62.68 Could not locate executable pgfortran
62.68 Could not locate executable nvfortran
62.68 Could not locate executable f90
62.68 Could not locate executable f77
62.68 Could not locate executable fort
62.68 Could not locate executable efort
62.68 Could not locate executable efc
62.68 Could not locate executable g77
62.68 Could not locate executable g95
62.68 Could not locate executable pathf95
62.68 Could not locate executable nagfor
62.68 don't know how to compile Fortran code on platform 'posix'
62.68 Traceback (most recent call last):
62.68 File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
62.68 main()
62.68 File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
62.68 json_out['return_val'] = hook(**hook_input['kwargs'])
62.68 File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
62.68 return hook(metadata_directory, config_settings)
62.68 File "/tmp/pip-build-env-ixwxejoq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 157, in prepare_metadata_for_build_wheel
62.68 self.run_setup()
62.68 File "/tmp/pip-build-env-ixwxejoq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 248, in run_setup
62.68 super(_BuildMetaLegacyBackend,
62.68 File "/tmp/pip-build-env-ixwxejoq/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 142, in run_setup
62.68 exec(compile(code, file, 'exec'), locals())
62.68 File "setup.py", line 508, in
62.68 setup_package()
62.68 File "setup.py", line 500, in setup_package
62.68 setup(**metadata)
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/core.py", line 169, in setup
62.68 return old_setup(**new_attr)
62.68 File "/tmp/pip-build-env-ixwxejoq/overlay/lib/python3.9/site-packages/setuptools/init.py", line 165, in setup
62.68 return distutils.core.setup(**attrs)
62.68 File "/usr/local/lib/python3.9/distutils/core.py", line 148, in setup
62.68 dist.run_commands()
62.68 File "/usr/local/lib/python3.9/distutils/dist.py", line 966, in run_commands
62.68 self.run_command(cmd)
62.68 File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command
62.68 cmd_obj.run()
62.68 File "/tmp/pip-build-env-ixwxejoq/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 31, in run
62.68 egg_info.run()
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/command/egg_info.py", line 24, in run
62.68 self.run_command("build_src")
62.68 File "/usr/local/lib/python3.9/distutils/cmd.py", line 313, in run_command
62.68 self.distribution.run_command(command)
62.68 File "/usr/local/lib/python3.9/distutils/dist.py", line 985, in run_command
62.68 cmd_obj.run()
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/command/build_src.py", line 144, in run
62.68 self.build_sources()
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/command/build_src.py", line 155, in build_sources
62.68 self.build_library_sources(*libname_info)
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/command/build_src.py", line 288, in build_library_sources
62.68 sources = self.generate_sources(sources, (lib_name, build_info))
62.68 File "/tmp/pip-install-3y0hlc6u/numpy_204ca03c78ab4456805c9b8c08ebf175/numpy/distutils/command/build_src.py", line 378, in generate_sources
62.68 source = func(extension, build_dir)
62.68 File "numpy/core/setup.py", line 663, in get_mathlib_info
62.68 raise RuntimeError("Broken toolchain: cannot link a simple C program")
62.68 RuntimeError: Broken toolchain: cannot link a simple C program
62.68 [end of output]
62.68
62.68 note: This error originates from a subprocess, and is likely not a problem with pip.
62.68 error: metadata-generation-failed
62.68
62.68 × Encountered error while generating package metadata.
62.68 ╰─> See above for output.
62.68
62.68 note: This is an issue with the package mentioned above, not pip.
62.68 hint: See above for details.
62.68
62.68 [notice] A new release of pip is available: 23.0.1 -> 23.3.1
62.68 [notice] To update, run: pip install --upgrade pip
62.68 [end of output]
62.68
62.68 note: This error originates from a subprocess, and is likely not a problem with pip.
62.69 error: subprocess-exited-with-error
62.69
62.69 × pip subprocess to install build dependencies did not run successfully.
62.69 │ exit code: 1
62.69 ╰─> See above for output.
62.69
62.69 note: This error originates from a subprocess, and is likely not a problem with pip.
63.38
63.38 [notice] A new release of pip is available: 23.0.1 -> 23.3.1
63.38 [notice] To update, run: pip install --upgrade pip


Dockerfile:4

2 | COPY . /app
3 | WORKDIR /app
4 | >>> RUN pip install --no-cache-dir -r requirements.txt
5 | CMD python app.py
6 |

ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code: 1

@davidaristotle2012
Copy link

You forgot to copy the requirements.txt file to your image:
COPY requirements.txt .

@PantengZhao
Copy link

i am facing this problem too.

@Mansi11235
Copy link

Hello here,
I am facing this issue too. Even after copying the requirements.txt

@Krish1015
Copy link

Can I know which base image you are using for building the container?

@ztm0929
Copy link

ztm0929 commented Feb 12, 2024

检查一下你的txt文件,docker无法识别本地路径的引用,应该将它替换成具体的pypi版本号,感谢GPT的答复,这对我解决了我的类似问题;
please checkout your requirements.txt, maybe the reason is package file. thanks GPT's answer, it's working for me.
✅ GOOD: altgraph==0.17.2
❌ BAD:
altgraph @ file:///System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot2/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-141/altgraph-0.17.2-py2.py3-none-any.whl

@Ghoshpratibha
Copy link

Thankyou davidaristotle2012 it worked

@ZGuangJie
Copy link

You forgot to copy the requirements.txt file to your image: COPY requirements.txt .

This answer solve my questions.

@Transposeon
Copy link

.

@harshdhamecha
Copy link

harshdhamecha commented Apr 13, 2024

I had a similar issue. I replaced python:3.9-alpine with python:3.9 and it worked!

@Himanshuk45
Copy link

Himanshuk45 commented May 1, 2024

I faced the same problem. This was my original docker code:
FROM python:3.8-alpine
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
CMD python app.py

I changed it to: FROM python:3.8-slim and now it builds smoothly without any errors.

@subhansu
Copy link

Dear All, Can someone please help to fix my issue.

Error Message: ERROR: failed to solve: process "/bin/sh -c PIP install -r requirements.txt" did not complete successfully: exit code: 127

Docker File content:
FROM python:3.9
COPY . /deployed
EXPOSE 5000
WORKDIR /deployed
RUN PIP install -r requirements.txt
CMD python my_flask_predict_Flassaggar_api.py

Requirement.txt content:
flask
flasgger

When trying to build docker image getting below error:
(base) E:\DockerImages>docker build -t rf-api-2 .
[+] Building 50.5s (8/8) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 188B 0.0s
=> [internal] load metadata for docker.io/library/python:3.9 1.9s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 1.66kB 0.0s
=> [1/4] FROM docker.io/library/python:3.9@sha256:70dce00379744edb10d8c7ee8339bbf964dcbcadc1da862bdc59dc746513c 47.6s
=> => resolve docker.io/library/python:3.9@sha256:70dce00379744edb10d8c7ee8339bbf964dcbcadc1da862bdc59dc746513c0 0.0s
=> => sha256:10d643a5fa823cd013a108b2076f4d2edf1b2a921f863b533e83ea5ed8d09bd4 64.14MB / 64.14MB 11.2s
=> => sha256:ca4e5d6727252f0dbc207fbf283cb95e278bf562bda42d35ce6c919583a110a0 49.55MB / 49.55MB 7.5s
=> => sha256:1a31a1694020fecdd5401eb998b939b9a5d9aacc9d56638308aa040a7e04420b 2.52kB / 2.52kB 0.0s
=> => sha256:c83186e947098d28b60a75d38fcb49830d8facbab7a61821c80522aa5cef0125 7.26kB / 7.26kB 0.0s
=> => sha256:30b93c12a9c9326732b35d9e3ebe57148abe33f8fa6e25ab76867410b0ccf876 24.05MB / 24.05MB 4.6s
=> => sha256:70dce00379744edb10d8c7ee8339bbf964dcbcadc1da862bdc59dc746513c04c 10.35kB / 10.35kB 0.0s
=> => sha256:d6dc1019d7935fe82827434da11bf96cf14e24979f8155e73b794286f10b7f05 211.24MB / 211.24MB 23.6s
=> => sha256:c387064957b7c6410118524b9ea38586f5c8a9977652336787ca17993d2932c6 6.16MB / 6.16MB 8.9s
=> => extracting sha256:ca4e5d6727252f0dbc207fbf283cb95e278bf562bda42d35ce6c919583a110a0 13.0s
=> => sha256:26766ebde4817068b187ab3f6f8d0c6989bc685d0deddc34c0e36731c7cfe317 15.82MB / 15.82MB 11.7s
=> => sha256:8a42d17fd0e28f72659a82ca54de4b3820cdbedf4fb3b5e2a802701386abcee9 232B / 232B 11.5s
=> => sha256:79eda865cc8a5f78a43ee16910c4d7f4d63957fbf913a0d7059ce99f4b69bb26 2.70MB / 2.70MB 12.1s
=> => extracting sha256:30b93c12a9c9326732b35d9e3ebe57148abe33f8fa6e25ab76867410b0ccf876 2.9s
=> => extracting sha256:10d643a5fa823cd013a108b2076f4d2edf1b2a921f863b533e83ea5ed8d09bd4 5.7s
=> => extracting sha256:d6dc1019d7935fe82827434da11bf96cf14e24979f8155e73b794286f10b7f05 14.4s
=> => extracting sha256:c387064957b7c6410118524b9ea38586f5c8a9977652336787ca17993d2932c6 0.6s
=> => extracting sha256:26766ebde4817068b187ab3f6f8d0c6989bc685d0deddc34c0e36731c7cfe317 1.0s
=> => extracting sha256:8a42d17fd0e28f72659a82ca54de4b3820cdbedf4fb3b5e2a802701386abcee9 0.0s
=> => extracting sha256:79eda865cc8a5f78a43ee16910c4d7f4d63957fbf913a0d7059ce99f4b69bb26 0.6s
=> [2/4] COPY . /deployed 0.5s
=> [3/4] WORKDIR /deployed 0.1s
=> ERROR [4/4] RUN PIP install -r requirements.txt 0.3s

[4/4] RUN PIP install -r requirements.txt:
0.278 /bin/sh: 1: PIP: not found


1 warning found (use --debug to expand):

  • JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 6)
    Dockerfile:5

3 | EXPOSE 5000
4 | WORKDIR /deployed
5 | >>> RUN PIP install -r requirements.txt
6 | CMD python my_flask_predict_Flassaggar_api.py

ERROR: failed to solve: process "/bin/sh -c PIP install -r requirements.txt" did not complete successfully: exit code: 127

(base) E:\DockerImages>

@chetan-pun
Copy link

I have also faced this error. It occurs when the version you have defined is out of the package context. For example : if the latest version of package transformers is 4.43.3 but you mistyped it as 4.443.3. In this case, the error will occur. So check the versions carefully before listing them into the requirements.txt file.

@subhansu
Copy link

subhansu commented Aug 3, 2024

Thanks Chetan. I checked my requirement.txt file, it has no specific version mentioned
FYI. here is content

flask
flasgger
scikit-learn
numpy
requests
pandas

@subhansu
Copy link

subhansu commented Aug 3, 2024

Issue still not solved. Error remains there although revision numbers not in requirements.txt. Any other idea how to resolve ?

@chetan-pun
Copy link

Make sure that you are in the right file and use this command : RUN pip install --no-cache-dir -r requirement.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests