Comments (11)
I had a similar issue. I replaced python:3.9-alpine
with python:3.9
and it worked!
from getting-started.
You forgot to copy the requirements.txt file to your image:
COPY requirements.txt .
from getting-started.
=> 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
from getting-started.
i am facing this problem too.
from getting-started.
Hello here,
I am facing this issue too. Even after copying the requirements.txt
from getting-started.
Can I know which base image you are using for building the container?
from getting-started.
检查一下你的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
from getting-started.
Thankyou davidaristotle2012 it worked
from getting-started.
You forgot to copy the requirements.txt file to your image: COPY requirements.txt .
This answer solve my questions.
from getting-started.
.
from getting-started.
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.
from getting-started.
Related Issues (20)
- Run docker/build-push-action@v3 error HOT 1
- import os from flask import Flask from flaskext.mysql import MySQL # For newer versions of flask-mysql # from flask.ext.mysql import MySQL # For older versions of flask-mysql app = Flask(__name__) mysql = MySQL() mysql_database_host = 'MYSQL_DATABASE_HOST' in os.environ and os.environ['MYSQL_DATABASE_HOST'] or 'localhost' # MySQL configurations app.config['MYSQL_DATABASE_USER'] = 'db_user' app.config['MYSQL_DATABASE_PASSWORD'] = 'Passw0rd' app.config['MYSQL_DATABASE_DB'] = 'employee_db' app.config['MYSQL_DATABASE_HOST'] = mysql_database_host mysql.init_app(app) conn = mysql.connect() cursor = conn.cursor() @app.route("/") def main(): return "Welcome!" @app.route('/how are you') def hello(): return 'I am good, how about you?' @app.route('/read from database') def read(): cursor.execute("SELECT * FROM em
- Start
- Replace docker scan with Docker Scout HOT 2
- Old command from exec/terminal inside docker desktop are not accessible.
- Connecting MySQL 5.1 container with python Error
- s
- codebuild fails in d middle of the Dockerfile
- Request for Adjustment: Relocation of Social Media Icons to the Left Side in a Vertical Layout for Optimal Utilization of Space
- Couldnt install nodejs and npm through docker file HOT 1
- Connection Issue from WSL to Docker Desktop Daemon on Windows
- Neither Microsoft azurite nor ArangoDB would launch or become available within docker
- RUN pip install -r requirements.txt not working
- ERROR: failed to solve: process "/bin/sh -c yarn install --production" did not complete successfully: exit code: 1
- Please enter a username matching the regular expression configured (addgroup error in Dockerfile)
- ERROR: failed to solve: error getting credentials - err: exit status 1, out: ``
- ERROR: failed to solve: process "/bin/sh -c yarn install --production" did not complete successfully: exit code: 139 HOT 1
- Docker Desktop wont start when installed on Ubuntu 24.04 HOT 1
- Image Building Best Practices page Invalid Node.js Link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getting-started.