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: Could not build wheels for numpy, which is required to install pyproject.toml-based projects #399

Open
tgermain25 opened this issue Apr 12, 2022 · 59 comments
Labels

Comments

@tgermain25
Copy link

Describe the bug
I cannot run download tslearn due to this Error. I have properly download numpy with conda (forge). I use

To Reproduce
pip install tslearn

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • OS: macOS Montery 12.3.1
  • Puce Apple M1 Pro
  • tslearn version 0.5.2
  • python 3.9.12
  • numpy 1.21.5

Additional context
(tslearn) tgermain@MBP-de-Thibaut ~ % pip install tslearn
Collecting tslearn
Using cached tslearn-0.5.2.tar.gz (484 kB)
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [916 lines of output]
Collecting setuptools
Using cached setuptools-62.1.0-py3-none-any.whl (1.1 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting numpy<=1.19
Using cached numpy-1.19.0.zip (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting Cython
Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml): started
Building wheel for numpy (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

    × Building wheel for numpy (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [888 lines of output]
        Running from numpy source directory.

"""
..........
""""""

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: T

@tgermain25 tgermain25 added the bug label Apr 12, 2022
@rtavenar
Copy link
Member

Hi @tgermain25

Can you pip install numpy ? It seems it's the numpy install that fails, not the tslearn one.

@tgermain25
Copy link
Author

Hi @rtavenar

Indeed it comes from numpy.
I have tried to do pip install for numpy, it works for version 1.22.3 but it doesn't work for 1.19 which is a requirement for tslearn.

@rtavenar
Copy link
Member

I would say the main constraint we have on numpy version is that it should match the constraints set by numba, so maybe a more recent numpy could be used.

@kunaljain94
Copy link

Hi @tgermain25
Have you fixed this issue?ANd if so, can you please help us with the solution?

@tgermain25
Copy link
Author

Hi @kunaljain94
I have not find any solution yet to my issue. If you have found I would take it as well :)

@wumirose
Copy link

I have exact same error with pip install zero-shot-re I had tried upgrading numpy but nothing changed. Please keep me in the loop, if you find a solution.

@momadmohaideen
Copy link

I also got the exact error when I'm installing the numpy in vir env. Please keep me in the loop. Thanks in advance.

@delahozdavidd
Copy link

I have the same error installing "chatterbot"

@VigneshTheBlaster
Copy link

Did you guys got solution

@momadmohaideen
Copy link

I also got the exact error when I'm installing the numpy in vir env. Please keep me in the loop. Thanks in advance.

Guys, I solved the issue for my case. I just downgraded the Python and as well as the Numpy. Moreover, I installed all these in the terminal, not in the Vir environment.

@rodinael
Copy link

rodinael commented Aug 9, 2022

Hey guys, Have the same error, please keep me updated if anyone could solve it! Thanks

@Mozolotov809
Copy link

I encountered the same error when installing cicflowmeter, python version 3.9.13

@fspider
Copy link

fspider commented Aug 17, 2022

The same Issue on my side.

        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS D:\git\EpicScraping> pip install numpy 
Requirement already satisfied: numpy in c:\users\codem\appdata\local\programs\python\python310\lib\site-packages (1.23.1)
PS D:\git\EpicScraping> python --version
Python 3.10.5

@fspider
Copy link

fspider commented Aug 17, 2022

The same Issue on my side.

        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
PS D:\git\EpicScraping> pip install numpy 
Requirement already satisfied: numpy in c:\users\codem\appdata\local\programs\python\python310\lib\site-packages (1.23.1)
PS D:\git\EpicScraping> python --version
Python 3.10.5

This issue has been solved when I am trying on Ubuntu.

@GreatYoungShaw
Copy link

oh my god same issue, with cisco8601

@rodinael
Copy link

Yes, I fixed it by download lower version of python you can try it.

@GreatYoungShaw
Copy link

OK I would try use python 3.8, thank you

@rominamir
Copy link

I still have the same problem with installing tslearn while having python 3.8.9

@rodinael
Copy link

rodinael commented Sep 8, 2022

Can you try python 3.8.10 and see if it works or not? and keep us updated. Thanks.

@Serenthia
Copy link

Same issue with Python 3.8.13 and installed numpy 1.23.2

@CS50-123-321
Copy link

Same issue, please who solved it?

@SenhorUnk
Copy link

I had the same error with numpy when trying to pip install monailabel from the MONAI project.
From my understanding, the error occurs because of a version problem.

The following article helped me to create a new virtual environment with a defined version of python (in my case 3.9.13 instead of python 3.10.xx). After activating the environment I double-checked the python version and was able to pip install monailabel.

@skorzan
Copy link

skorzan commented Sep 14, 2022

I've been struggling for a long time with variable version of alpine image I need to install numpy on alpine 3.10 or 3.16
but without successful also I've tried different version of numpy and got the same error. Please put some insights, Thx

`
=> ERROR [5/6] RUN pip install numpy 24.1s

[5/6] RUN pip install numpy:
#9 2.513 Collecting numpy
#9 2.884 Downloading numpy-1.23.3.tar.gz (10.7 MB)
#9 5.227 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 5.0 MB/s eta 0:00:00
#9 6.440 Installing build dependencies: started
#9 12.51 Installing build dependencies: finished with status 'done'
#9 12.52 Getting requirements to build wheel: started
#9 13.13 Getting requirements to build wheel: finished with status 'done'
#9 13.14 Preparing metadata (pyproject.toml): started
#9 13.59 Preparing metadata (pyproject.toml): finished with status 'done'
#9 13.60 Building wheels for collected packages: numpy
#9 13.60 Building wheel for numpy (pyproject.toml): started
#9 23.88 Building wheel for numpy (pyproject.toml): finished with status 'error'
#9 23.91 error: subprocess-exited-with-error
#9 23.91
#9 23.91 × Building wheel for numpy (pyproject.toml) did not run successfully.
#9 23.91 │ exit code: 1
#9 23.91 ╰─> [258 lines of output]
#9 23.91 Running from numpy source directory.
#9 23.91 setup.py:86: DeprecationWarning:
#9 23.91
#9 23.91 numpy.distutils is deprecated since NumPy 1.23.0, as a result
#9 23.91 of the deprecation of distutils itself. It will be removed for
#9 23.91 Python >= 3.12. For older Python versions it will remain present.
#9 23.91 It is recommended to use setuptools < 60.0 for those Python versions.
#9 23.91 For more details, see:
#9 23.91 https://numpy.org/devdocs/reference/distutils_status_migration.html
#9 23.91
#9 23.91
#9 23.91 import numpy.distutils.command.sdist
#9 23.91 Processing numpy/random/_bounded_integers.pxd.in
#9 23.91 Processing numpy/random/_pcg64.pyx
#9 23.91 Processing numpy/random/_philox.pyx
#9 23.91 Processing numpy/random/mtrand.pyx
#9 23.91 Processing numpy/random/_generator.pyx
#9 23.91 Processing numpy/random/_common.pyx
#9 23.91 Processing numpy/random/_mt19937.pyx
#9 23.91 Processing numpy/random/_sfc64.pyx
#9 23.91 Processing numpy/random/_bounded_integers.pyx.in
#9 23.91 Processing numpy/random/bit_generator.pyx
#9 23.91 Cythonizing sources
#9 23.91 INFO: blas_opt_info:
#9 23.91 INFO: blas_armpl_info:
#9 23.91 INFO: customize UnixCCompiler
#9 23.91 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: blas_mkl_info:
#9 23.91 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: blis_info:
#9 23.91 INFO: libraries blis not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: openblas_info:
#9 23.91 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: accelerate_info:
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_3_10_blas_threads_info:
#9 23.91 INFO: Setting PTATLAS=ATLAS
#9 23.91 INFO: libraries tatlas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_3_10_blas_info:
#9 23.91 INFO: libraries satlas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_blas_threads_info:
#9 23.91 INFO: Setting PTATLAS=ATLAS
#9 23.91 INFO: libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_blas_info:
#9 23.91 INFO: libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 /tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/system_info.py:2077: UserWarning:
#9 23.91 Optimized (vendor) Blas libraries are not found.
#9 23.91 Falls back to netlib Blas library which has worse performance.
#9 23.91 A better performance should be easily gained by switching
#9 23.91 Blas library.
#9 23.91 if self._calc_info(blas):
#9 23.91 INFO: blas_info:
#9 23.91 INFO: libraries blas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 /tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/system_info.py:2077: UserWarning:
#9 23.91 Blas (http://www.netlib.org/blas/) libraries not found.
#9 23.91 Directories to search for the libraries can be specified in the
#9 23.91 numpy/distutils/site.cfg file (section [blas]) or by setting
#9 23.91 the BLAS environment variable.
#9 23.91 if self._calc_info(blas):
#9 23.91 INFO: blas_src_info:
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 /tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/system_info.py:2077: UserWarning:
#9 23.91 Blas (http://www.netlib.org/blas/) sources not found.
#9 23.91 Directories to search for the sources can be specified in the
#9 23.91 numpy/distutils/site.cfg file (section [blas_src]) or by setting
#9 23.91 the BLAS_SRC environment variable.
#9 23.91 if self.calc_info(blas):
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 non-existing path in 'numpy/distutils': 'site.cfg'
#9 23.91 INFO: lapack_opt_info:
#9 23.91 INFO: lapack_armpl_info:
#9 23.91 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: lapack_mkl_info:
#9 23.91 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: openblas_lapack_info:
#9 23.91 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: openblas_clapack_info:
#9 23.91 INFO: libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: flame_info:
#9 23.91 INFO: libraries flame not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_3_10_threads_info:
#9 23.91 INFO: Setting PTATLAS=ATLAS
#9 23.91 INFO: libraries tatlas,tatlas not found in /usr/local/lib
#9 23.91 INFO: libraries tatlas,tatlas not found in /usr/lib
#9 23.91 INFO: <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_3_10_info:
#9 23.91 INFO: libraries satlas,satlas not found in /usr/local/lib
#9 23.91 INFO: libraries satlas,satlas not found in /usr/lib
#9 23.91 INFO: <class 'numpy.distutils.system_info.atlas_3_10_info'>
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_threads_info:
#9 23.91 INFO: Setting PTATLAS=ATLAS
#9 23.91 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
#9 23.91 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/lib
#9 23.91 INFO: <class 'numpy.distutils.system_info.atlas_threads_info'>
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: atlas_info:
#9 23.91 INFO: libraries f77blas,cblas,atlas not found in /usr/local/lib
#9 23.91 INFO: libraries f77blas,cblas,atlas not found in /usr/lib
#9 23.91 INFO: <class 'numpy.distutils.system_info.atlas_info'>
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: lapack_info:
#9 23.91 INFO: libraries lapack not found in ['/usr/local/lib', '/usr/lib']
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 /tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/system_info.py:1902: UserWarning:
#9 23.91 Lapack (http://www.netlib.org/lapack/) libraries not found.
#9 23.91 Directories to search for the libraries can be specified in the
#9 23.91 numpy/distutils/site.cfg file (section [lapack]) or by setting
#9 23.91 the LAPACK environment variable.
#9 23.91 return getattr(self, 'calc_info{}'.format(name))()
#9 23.91 INFO: lapack_src_info:
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 /tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/system_info.py:1902: UserWarning:
#9 23.91 Lapack (http://www.netlib.org/lapack/) sources not found.
#9 23.91 Directories to search for the sources can be specified in the
#9 23.91 numpy/distutils/site.cfg file (section [lapack_src]) or by setting
#9 23.91 the LAPACK_SRC environment variable.
#9 23.91 return getattr(self, 'calc_info{}'.format(name))()
#9 23.91 INFO: NOT AVAILABLE
#9 23.91 INFO:
#9 23.91 INFO: numpy_linalg_lapack_lite:
#9 23.91 INFO: FOUND:
#9 23.91 INFO: language = c
#9 23.91 INFO: define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64
')]
#9 23.91 INFO:
#9 23.91 Warning: attempted relative import with no known parent package
#9 23.91 /usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
#9 23.91 warnings.warn(msg)
#9 23.91 running bdist_wheel
#9 23.91 running build
#9 23.91 running config_cc
#9 23.91 INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
#9 23.91 running config_fc
#9 23.91 INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
#9 23.91 running build_src
#9 23.91 INFO: build_src
#9 23.91 INFO: building py_modules sources
#9 23.91 creating build
#9 23.91 creating build/src.linux-x86_64-3.10
#9 23.91 creating build/src.linux-x86_64-3.10/numpy
#9 23.91 creating build/src.linux-x86_64-3.10/numpy/distutils
#9 23.91 INFO: building library "npymath" sources
#9 23.91 WARN: Could not locate executable armflang
#9 23.91 WARN: Could not locate executable gfortran
#9 23.91 WARN: Could not locate executable f95
#9 23.91 WARN: Could not locate executable ifort
#9 23.91 WARN: Could not locate executable ifc
#9 23.91 WARN: Could not locate executable lf95
#9 23.91 WARN: Could not locate executable pgfortran
#9 23.91 WARN: Could not locate executable nvfortran
#9 23.91 WARN: Could not locate executable f90
#9 23.91 WARN: Could not locate executable f77
#9 23.91 WARN: Could not locate executable fort
#9 23.91 WARN: Could not locate executable efort
#9 23.91 WARN: Could not locate executable efc
#9 23.91 WARN: Could not locate executable g77
#9 23.91 WARN: Could not locate executable g95
#9 23.91 WARN: Could not locate executable pathf95
#9 23.91 WARN: Could not locate executable nagfor
#9 23.91 WARN: Could not locate executable frt
#9 23.91 WARN: don't know how to compile Fortran code on platform 'posix'
#9 23.91
#9 23.91
#9 23.91 [Errno 2] No such file or directory: 'gcc'
#9 23.91
#9 23.91
#9 23.91 Traceback (most recent call last):
#9 23.91 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
#9 23.91 main()
#9 23.91 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
#9 23.91 json_out['return_val'] = hook(**hook_input['kwargs'])
#9 23.91 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
#9 23.91 return _build_backend().build_wheel(wheel_directory, config_settings,
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
#9 23.91 return self._build_with_temp_dir(['bdist_wheel'], '.whl',
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
#9 23.91 self.run_setup()
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup
#9 23.91 super(_BuildMetaLegacyBackend,
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
#9 23.91 exec(compile(code, file, 'exec'), locals())
#9 23.91 File "setup.py", line 494, in
#9 23.91 setup_package()
#9 23.91 File "setup.py", line 486, in setup_package
#9 23.91 setup(**metadata)
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/core.py", line 169, in setup
#9 23.91 return old_setup(**new_attr)
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/setuptools/init.py", line 153, in setup
#9 23.91 return distutils.core.setup(**attrs)
#9 23.91 File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
#9 23.91 dist.run_commands()
#9 23.91 File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
#9 23.91 self.run_command(cmd)
#9 23.91 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 23.91 cmd_obj.run()
#9 23.91 File "/tmp/pip-build-env-zut4kj09/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
#9 23.91 self.run_command('build')
#9 23.91 File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
#9 23.91 self.distribution.run_command(command)
#9 23.91 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 23.91 cmd_obj.run()
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/command/build.py", line 62, in run
#9 23.91 old_build.run(self)
#9 23.91 File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
#9 23.91 self.run_command(cmd_name)
#9 23.91 File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
#9 23.91 self.distribution.run_command(command)
#9 23.91 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 23.91 cmd_obj.run()
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/command/build_src.py", line 144, in run
#9 23.91 self.build_sources()
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/command/build_src.py", line 155, in build_sources
#9 23.91 self.build_library_sources(*libname_info)
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/command/build_src.py", line 288, in build_library_sources
#9 23.91 sources = self.generate_sources(sources, (lib_name, build_info))
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/distutils/command/build_src.py", line 378, in generate_sources
#9 23.91 source = func(extension, build_dir)
#9 23.91 File "/tmp/pip-install-kqg3a8j1/numpy_24fddfe2bb5c4521bf773bc17d0c3f93/numpy/core/setup.py", line 758, in get_mathlib_info
#9 23.91 raise RuntimeError(
#9 23.91 RuntimeError: Broken toolchain: cannot link a simple C program.
#9 23.91 [end of output]
#9 23.91
#9 23.91 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 23.91 ERROR: Failed building wheel for numpy
#9 23.91 Failed to build numpy
#9 23.91 ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects


executor failed running [/bin/sh -c pip install numpy]: exit code: 1

C:\Users\skorzan\Downloads>docker build -t stakor/spark:worker_pyarrow_3.2.1_numpy_pyarrow C:\Users\skorzan\Downloads\spark_worker\spark_worker
[+] Building 23.3s (9/10)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 666B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/stakor/spark:base_alpine_3_16_2 0.0s
=> [1/6] FROM docker.io/stakor/spark:base_alpine_3_16_2 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 1.77kB 0.0s
=> CACHED [2/6] COPY worker.sh / 0.0s
=> CACHED [3/6] COPY elasticsearch-hadoop-8.1.1/dist/* /spark/jars/ 0.0s
=> CACHED [4/6] RUN ln -s /usr/include/locale.h /usr/include/xlocale.h 0.0s
=> ERROR [5/6] RUN pip install numpy==1.22.3 23.2s

[5/6] RUN pip install numpy==1.22.3:
#9 2.202 Collecting numpy==1.22.3
#9 2.555 Downloading numpy-1.22.3.zip (11.5 MB)
#9 3.765 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.5/11.5 MB 12.2 MB/s eta 0:00:00
#9 4.366 Installing build dependencies: started
#9 10.63 Installing build dependencies: finished with status 'done'
#9 10.63 Getting requirements to build wheel: started
#9 11.13 Getting requirements to build wheel: finished with status 'done'
#9 11.13 Preparing metadata (pyproject.toml): started
#9 11.61 Preparing metadata (pyproject.toml): finished with status 'done'
#9 11.61 Building wheels for collected packages: numpy
#9 11.61 Building wheel for numpy (pyproject.toml): started
#9 22.95 Building wheel for numpy (pyproject.toml): finished with status 'error'
#9 22.97 error: subprocess-exited-with-error
#9 22.97
#9 22.97 × Building wheel for numpy (pyproject.toml) did not run successfully.
#9 22.97 │ exit code: 1
#9 22.97 ╰─> [249 lines of output]
#9 22.97 Running from numpy source directory.
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/tools/cythonize.py:63: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
#9 22.97 from distutils.version import LooseVersion
#9 22.97 Processing numpy/random/_bounded_integers.pxd.in
#9 22.97 Processing numpy/random/_pcg64.pyx
#9 22.97 Processing numpy/random/_philox.pyx
#9 22.97 Processing numpy/random/mtrand.pyx
#9 22.97 Processing numpy/random/_generator.pyx
#9 22.97 Processing numpy/random/_common.pyx
#9 22.97 Processing numpy/random/_mt19937.pyx
#9 22.97 Processing numpy/random/_sfc64.pyx
#9 22.97 Processing numpy/random/_bounded_integers.pyx.in
#9 22.97 Processing numpy/random/bit_generator.pyx
#9 22.97 Cythonizing sources
#9 22.97 INFO: blas_opt_info:
#9 22.97 INFO: blas_armpl_info:
#9 22.97 INFO: customize UnixCCompiler
#9 22.97 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: blas_mkl_info:
#9 22.97 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: blis_info:
#9 22.97 INFO: libraries blis not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: openblas_info:
#9 22.97 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: accelerate_info:
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_3_10_blas_threads_info:
#9 22.97 INFO: Setting PTATLAS=ATLAS
#9 22.97 INFO: libraries tatlas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_3_10_blas_info:
#9 22.97 INFO: libraries satlas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_blas_threads_info:
#9 22.97 INFO: Setting PTATLAS=ATLAS
#9 22.97 INFO: libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_blas_info:
#9 22.97 INFO: libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/system_info.py:2077: UserWarning:
#9 22.97 Optimized (vendor) Blas libraries are not found.
#9 22.97 Falls back to netlib Blas library which has worse performance.
#9 22.97 A better performance should be easily gained by switching
#9 22.97 Blas library.
#9 22.97 if self._calc_info(blas):
#9 22.97 INFO: blas_info:
#9 22.97 INFO: libraries blas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/system_info.py:2077: UserWarning:
#9 22.97 Blas (http://www.netlib.org/blas/) libraries not found.
#9 22.97 Directories to search for the libraries can be specified in the
#9 22.97 numpy/distutils/site.cfg file (section [blas]) or by setting
#9 22.97 the BLAS environment variable.
#9 22.97 if self._calc_info(blas):
#9 22.97 INFO: blas_src_info:
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/system_info.py:2077: UserWarning:
#9 22.97 Blas (http://www.netlib.org/blas/) sources not found.
#9 22.97 Directories to search for the sources can be specified in the
#9 22.97 numpy/distutils/site.cfg file (section [blas_src]) or by setting
#9 22.97 the BLAS_SRC environment variable.
#9 22.97 if self.calc_info(blas):
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 non-existing path in 'numpy/distutils': 'site.cfg'
#9 22.97 INFO: lapack_opt_info:
#9 22.97 INFO: lapack_armpl_info:
#9 22.97 INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: lapack_mkl_info:
#9 22.97 INFO: libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: openblas_lapack_info:
#9 22.97 INFO: libraries openblas not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: openblas_clapack_info:
#9 22.97 INFO: libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: flame_info:
#9 22.97 INFO: libraries flame not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_3_10_threads_info:
#9 22.97 INFO: Setting PTATLAS=ATLAS
#9 22.97 INFO: libraries tatlas,tatlas not found in /usr/local/lib
#9 22.97 INFO: libraries tatlas,tatlas not found in /usr/lib
#9 22.97 INFO: <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_3_10_info:
#9 22.97 INFO: libraries satlas,satlas not found in /usr/local/lib
#9 22.97 INFO: libraries satlas,satlas not found in /usr/lib
#9 22.97 INFO: <class 'numpy.distutils.system_info.atlas_3_10_info'>
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_threads_info:
#9 22.97 INFO: Setting PTATLAS=ATLAS
#9 22.97 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
#9 22.97 INFO: libraries ptf77blas,ptcblas,atlas not found in /usr/lib
#9 22.97 INFO: <class 'numpy.distutils.system_info.atlas_threads_info'>
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: atlas_info:
#9 22.97 INFO: libraries f77blas,cblas,atlas not found in /usr/local/lib
#9 22.97 INFO: libraries f77blas,cblas,atlas not found in /usr/lib
#9 22.97 INFO: <class 'numpy.distutils.system_info.atlas_info'>
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: lapack_info:
#9 22.97 INFO: libraries lapack not found in ['/usr/local/lib', '/usr/lib']
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/system_info.py:1902: UserWarning:
#9 22.97 Lapack (http://www.netlib.org/lapack/) libraries not found.
#9 22.97 Directories to search for the libraries can be specified in the
#9 22.97 numpy/distutils/site.cfg file (section [lapack]) or by setting
#9 22.97 the LAPACK environment variable.
#9 22.97 return getattr(self, 'calc_info{}'.format(name))()
#9 22.97 INFO: lapack_src_info:
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 /tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/system_info.py:1902: UserWarning:
#9 22.97 Lapack (http://www.netlib.org/lapack/) sources not found.
#9 22.97 Directories to search for the sources can be specified in the
#9 22.97 numpy/distutils/site.cfg file (section [lapack_src]) or by setting
#9 22.97 the LAPACK_SRC environment variable.
#9 22.97 return getattr(self, 'calc_info{}'.format(name))()
#9 22.97 INFO: NOT AVAILABLE
#9 22.97 INFO:
#9 22.97 INFO: numpy_linalg_lapack_lite:
#9 22.97 INFO: FOUND:
#9 22.97 INFO: language = c
#9 22.97 INFO: define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64
')]
#9 22.97 INFO:
#9 22.97 Warning: attempted relative import with no known parent package
#9 22.97 /usr/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
#9 22.97 warnings.warn(msg)
#9 22.97 running bdist_wheel
#9 22.97 running build
#9 22.97 running config_cc
#9 22.97 INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
#9 22.97 running config_fc
#9 22.97 INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
#9 22.97 running build_src
#9 22.97 INFO: build_src
#9 22.97 INFO: building py_modules sources
#9 22.97 creating build
#9 22.97 creating build/src.linux-x86_64-3.10
#9 22.97 creating build/src.linux-x86_64-3.10/numpy
#9 22.97 creating build/src.linux-x86_64-3.10/numpy/distutils
#9 22.97 INFO: building library "npymath" sources
#9 22.97 WARN: Could not locate executable armflang
#9 22.97 WARN: Could not locate executable gfortran
#9 22.97 WARN: Could not locate executable f95
#9 22.97 WARN: Could not locate executable ifort
#9 22.97 WARN: Could not locate executable ifc
#9 22.97 WARN: Could not locate executable lf95
#9 22.97 WARN: Could not locate executable pgfortran
#9 22.97 WARN: Could not locate executable nvfortran
#9 22.97 WARN: Could not locate executable f90
#9 22.97 WARN: Could not locate executable f77
#9 22.97 WARN: Could not locate executable fort
#9 22.97 WARN: Could not locate executable efort
#9 22.97 WARN: Could not locate executable efc
#9 22.97 WARN: Could not locate executable g77
#9 22.97 WARN: Could not locate executable g95
#9 22.97 WARN: Could not locate executable pathf95
#9 22.97 WARN: Could not locate executable nagfor
#9 22.97 WARN: Could not locate executable frt
#9 22.97 WARN: don't know how to compile Fortran code on platform 'posix'
#9 22.97
#9 22.97
#9 22.97 [Errno 2] No such file or directory: 'gcc'
#9 22.97
#9 22.97
#9 22.97 Traceback (most recent call last):
#9 22.97 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
#9 22.97 main()
#9 22.97 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
#9 22.97 json_out['return_val'] = hook(**hook_input['kwargs'])
#9 22.97 File "/usr/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
#9 22.97 return _build_backend().build_wheel(wheel_directory, config_settings,
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
#9 22.97 return self._build_with_temp_dir(['bdist_wheel'], '.whl',
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
#9 22.97 self.run_setup()
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup
#9 22.97 super(_BuildMetaLegacyBackend,
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
#9 22.97 exec(compile(code, file, 'exec'), locals())
#9 22.97 File "setup.py", line 461, in
#9 22.97 setup_package()
#9 22.97 File "setup.py", line 453, in setup_package
#9 22.97 setup(**metadata)
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/core.py", line 169, in setup
#9 22.97 return old_setup(**new_attr)
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/setuptools/init.py", line 153, in setup
#9 22.97 return distutils.core.setup(**attrs)
#9 22.97 File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
#9 22.97 dist.run_commands()
#9 22.97 File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
#9 22.97 self.run_command(cmd)
#9 22.97 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 22.97 cmd_obj.run()
#9 22.97 File "/tmp/pip-build-env-z3g0r1w3/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
#9 22.97 self.run_command('build')
#9 22.97 File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
#9 22.97 self.distribution.run_command(command)
#9 22.97 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 22.97 cmd_obj.run()
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/command/build.py", line 61, in run
#9 22.97 old_build.run(self)
#9 22.97 File "/usr/lib/python3.10/distutils/command/build.py", line 135, in run
#9 22.97 self.run_command(cmd_name)
#9 22.97 File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
#9 22.97 self.distribution.run_command(command)
#9 22.97 File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
#9 22.97 cmd_obj.run()
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/command/build_src.py", line 144, in run
#9 22.97 self.build_sources()
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/command/build_src.py", line 155, in build_sources
#9 22.97 self.build_library_sources(*libname_info)
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/command/build_src.py", line 288, in build_library_sources
#9 22.97 sources = self.generate_sources(sources, (lib_name, build_info))
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/distutils/command/build_src.py", line 378, in generate_sources
#9 22.97 source = func(extension, build_dir)
#9 22.97 File "/tmp/pip-install-xkl7pgud/numpy_7ca37a5315354591aba68ab744e9872c/numpy/core/setup.py", line 708, in get_mathlib_info
#9 22.97 raise RuntimeError(
#9 22.97 RuntimeError: Broken toolchain: cannot link a simple C program.
#9 22.97 [end of output]
#9 22.97
#9 22.97 note: This error originates from a subprocess, and is likely not a problem with pip.
#9 22.97 ERROR: Failed building wheel for numpy
#9 22.97 Failed to build numpy
#9 22.97 ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects


executor failed running [/bin/sh -c pip install numpy==1.22.3]: exit code: 1
`

@GigaHertzLegacy-SpiderX
Copy link

If you are using PyCharm. Manually install the Module From Python Interpreter

@Abdulkereem
Copy link

if you are still having this issue just pip install numpy==1.20.0

@sspaeti
Copy link

sspaeti commented Oct 13, 2022

Same here when installing DuckDB duckdb/duckdb#3779 (comment) within docker and M1. Does it have to do with the new apple silicon? Everything works if I install it locally, but it fails inside docker, is that the same for you?

Update: It works with this StackOverflow fix - adding this to my Dockerfile :

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install --upgrade numpy

PS: It worked with different numpy versions (1. and different Python version (py3.8/3.9)

@skorzan
Copy link

skorzan commented Oct 13, 2022 via email

@skorzan
Copy link

skorzan commented Oct 13, 2022

for example

`FROM continuumio/miniconda3:latest

COPY master.sh /
COPY elasticsearch-hadoop-8.1.1/dist/* /spark/jars/
ENV PYSPARK_DRIVER_PYTHON=/opt/conda/bin/python
ENV PYSPARK_PYTHON=/opt/conda/bin/python
ENV PYTHONPATH=/opt/conda/bin/python
ENV SPARK_MASTER_PORT 7077
ENV SPARK_MASTER_WEBUI_PORT 8080
ENV SPARK_MASTER_LOG /spark/logs
RUN conda install -c conda-forge findspark
RUN conda install -c conda-forge openjdk
RUN conda install -c conda-forge elasticsearch==8.1.0
RUN conda install -c conda-forge pyspark==3.2.1
RUN conda install -c conda-forge pyarrow==8.0.0
RUN conda install -c conda-forge prophet
RUN conda install -c conda-forge pandas

EXPOSE 8080 7077 6066

CMD ["/bin/bash", "/master.sh"]`

@sspaeti
Copy link

sspaeti commented Oct 13, 2022

Thank you so much @skorzan, very much appreciated. That worked like a charm! Unfortunately, I'm bound to some base images, but I could also make it work with python:3.9.11 image.

@F1reWs
Copy link

F1reWs commented Dec 25, 2022

Try to update pip

@liyunrui
Copy link

does it solve already?

@marinacruzjordao
Copy link

Same issue here

@Zaba107
Copy link

Zaba107 commented Jan 6, 2023

You can build from source, looks like the old 0.5.2 wheel was build with the numpy restrain numpy <=1.19xx which is removed in main
pip install https://github.com/tslearn-team/tslearn/archive/main.zip

@YannCabanes
Copy link
Contributor

Hello @Zaba107, @marinacruzjordao, @liyunrui, @kev26, @priyank-cloud, @sspaeti, @tgermain25, @kunaljain94, @wumirose, @momadmohaideen, @VigneshTheBlaster, @rodinael, @fspider, @skorzan and everyone who had troubles installing tslearn.
@rtavenar and I have release a new patch of tslearn: https://pypi.org/project/tslearn/0.5.3.2/
Could you please tell us if you still have problems to install this lasted version of tslearn? Or is the installation problem solved by this latest tslearn version release?

@Zaba107
Copy link

Zaba107 commented Jan 20, 2023

patch tslearn-0.5.3.2 works with python 3.10 thanks.

@ahmed-elshamanhory
Copy link

The following commands helped to solve that error in my case:

  • xcode-select --install
  • pip3 install --platform manylinux2010_x86_64 faster_fifo

I'm using M1 with macOS 13.2(22D49)

@yeyuchen198
Copy link

Could not build wheels for numpy, which is required to install pyproject.toml-based projects

Same problem when I:
pip install numpy

on Android Termux app

@pradeepa1511
Copy link

I used python 3.8.0 and numpy==1.22.0 . It worked for me

@LoveCamille
Copy link

If you are using the ARM arch Mac and meet this error "ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects", that's because you are using the arm python environment and it can't match with our numpy version. To solve this, use

CONDA_SUBDIR=osx-64 conda create -n myenv python=3.6.9

When creating the python environment.

@techbrain19
Copy link

(env) Techbrain:Django-Twitter-Clone-master techbrain$ pip install opencv-python
Collecting opencv-python
Downloading opencv-python-4.7.0.72.tar.gz (91.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 91.1/91.1 MB 1.5 MB/s eta 0:00:00
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [232 lines of output]
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version <= "3.9" and sys_platform == "darwin" and platform_machine == "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.9" and platform_machine != "aarch64" and platform_machine != "arm64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.10" and platform_system != "Darwin"' don't match your environment
Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Darwin"' don't match your environment
Collecting setuptools==59.2.0
Downloading setuptools-59.2.0-py3-none-any.whl (952 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 952.0/952.0 kB 970.1 kB/s eta 0:00:00
Collecting wheel==0.37.0
Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Collecting cmake>=3.1
Using cached cmake-3.26.3-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (45.6 MB)
Collecting pip
Using cached pip-23.1.2-py3-none-any.whl (2.1 MB)
Collecting scikit-build>=0.13.2
Using cached scikit_build-0.17.6-py3-none-any.whl (84 kB)
Collecting numpy==1.22.0
Downloading numpy-1.22.0.zip (11.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.3/11.3 MB 2.7 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting distro (from scikit-build>=0.13.2)
Using cached distro-1.8.0-py3-none-any.whl (20 kB)
Collecting packaging (from scikit-build>=0.13.2)
Using cached packaging-23.1-py3-none-any.whl (48 kB)
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml): started
Building wheel for numpy (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

    × Building wheel for numpy (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [186 lines of output]
        setup.py:66: RuntimeWarning: NumPy 1.22.0 may not yet support Python 3.11.
          warnings.warn(
        Running from numpy source directory.
        Processing numpy/random/_bounded_integers.pxd.in
        Processing numpy/random/_philox.pyx
        Processing numpy/random/_bounded_integers.pyx.in
        Processing numpy/random/_sfc64.pyx
        Processing numpy/random/_mt19937.pyx
        Processing numpy/random/bit_generator.pyx
        Processing numpy/random/mtrand.pyx
        Processing numpy/random/_generator.pyx
        Processing numpy/random/_pcg64.pyx
        Processing numpy/random/_common.pyx
        Cythonizing sources
        INFO: blas_opt_info:
        INFO: blas_armpl_info:
        INFO: customize UnixCCompiler
        INFO:   libraries armpl_lp64_mp not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: blas_mkl_info:
        INFO:   libraries mkl_rt not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: blis_info:
        INFO:   libraries blis not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: openblas_info:
        INFO:   libraries openblas not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: accelerate_info:
        INFO:   libraries accelerate not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO: Library accelerate was not found. Ignoring
        INFO:   libraries veclib not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO: Library veclib was not found. Ignoring
        INFO:   FOUND:
        INFO:     extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        INFO:     extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        INFO:     define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        INFO:
        INFO:   FOUND:
        INFO:     extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        INFO:     extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        INFO:     define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        INFO:
        svnversion: error: The subversion command line tools are no longer provided by Xcode.
        non-existing path in 'numpy/distutils': 'site.cfg'
        INFO: lapack_opt_info:
        INFO: lapack_armpl_info:
        INFO:   libraries armpl_lp64_mp not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: lapack_mkl_info:
        INFO:   libraries mkl_rt not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: openblas_lapack_info:
        INFO:   libraries openblas not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: openblas_clapack_info:
        INFO:   libraries openblas,lapack not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO: flame_info:
        INFO:   libraries flame not found in ['/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib', '/usr/local/lib', '/usr/lib']
        INFO:   NOT AVAILABLE
        INFO:
        INFO:   FOUND:
        INFO:     extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        INFO:     extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        INFO:     define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        INFO:
        Warning: attempted relative import with no known parent package
        /private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        running bdist_wheel
        running build
        running config_cc
        INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        INFO: build_src
        INFO: building py_modules sources
        creating build
        creating build/src.macosx-10.9-universal2-3.11
        creating build/src.macosx-10.9-universal2-3.11/numpy
        creating build/src.macosx-10.9-universal2-3.11/numpy/distutils
        INFO: building library "npymath" sources
        WARN: Could not locate executable gfortran
        WARN: Could not locate executable f95
        WARN: Could not locate executable nagfor
        WARN: Could not locate executable f90
        WARN: Could not locate executable f77
        WARN: Could not locate executable xlf90
        WARN: Could not locate executable xlf
        WARN: Could not locate executable ifort
        WARN: Could not locate executable ifc
        WARN: Could not locate executable g77
        WARN: Could not locate executable g95
        WARN: Could not locate executable pgfortran
        WARN: don't know how to compile Fortran code on platform 'posix'
        creating build/src.macosx-10.9-universal2-3.11/numpy/core
        creating build/src.macosx-10.9-universal2-3.11/numpy/core/src
        creating build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath
        INFO: conv_template:> build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath/npy_math_internal.h
        INFO:   adding 'build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath' to include_dirs.
        INFO: conv_template:> build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath/ieee754.c
        INFO: conv_template:> build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath/npy_math_complex.c
        INFO: None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.11/numpy/core/src/npymath/npy_math_internal.h']
        INFO: building library "npyrandom" sources
        INFO: building extension "numpy.core._multiarray_tests" sources
        creating build/src.macosx-10.9-universal2-3.11/numpy/core/src/multiarray
        INFO: conv_template:> build/src.macosx-10.9-universal2-3.11/numpy/core/src/multiarray/_multiarray_tests.c
        INFO: building extension "numpy.core._multiarray_umath" sources
        Traceback (most recent call last):
          File "/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
            main()
          File "/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/Users/mac/Downloads/Django-Twitter-Clone-master/env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
            return _build_backend().build_wheel(wheel_directory, config_settings,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 230, in build_wheel
            return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
            self.run_setup()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup
            self).run_setup(setup_script=setup_script)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 450, in <module>
            setup_package()
          File "setup.py", line 442, in setup_package
            setup(**metadata)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/core.py", line 169, in setup
            return old_setup(**new_attr)
                   ^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup
            dist.run_commands()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
            self.run_command(cmd)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 299, in run
            self.run_command('build')
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/command/build.py", line 61, in run
            old_build.run(self)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 135, in run
            self.run_command(cmd_name)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-build-env-78qwso29/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/command/build_src.py", line 144, in run
            self.build_sources()
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/command/build_src.py", line 161, in build_sources
            self.build_extension_sources(ext)
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
            sources = self.generate_sources(sources, ext)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/distutils/command/build_src.py", line 378, in generate_sources
            source = func(extension, build_dir)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/core/setup.py", line 449, in generate_config_h
            moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/core/setup.py", line 45, in check_types
            out = check_types(*a, **kw)
                  ^^^^^^^^^^^^^^^^^^^^^
          File "/private/var/folders/kn/9sg76wv14wv81j21hdgl279c0000gn/T/pip-install-dr3jyyoi/numpy_8a0e1bbaa898417ea60533cd6e2ea44c/numpy/core/setup.py", line 304, in check_types
            raise SystemError(
        SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
  Failed to build numpy
  ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

@Song-xx
Copy link

Song-xx commented Jun 12, 2023

i have the same mac and same error with you, oh, mac is terrible for a python user.

@mohamed-alired
Copy link

mohamed-alired commented Jun 27, 2023

i have fixed mine here's what you have to do
on my case
i was using numpy version 1.23.4 but using python 3
i found in documentation of this version of numpy that it requires python 3.8
i upgraded my docker image to use python 3.8 and it works

@iT-Boyer
Copy link

iT-Boyer commented Aug 6, 2023

Could not build wheels for numpy, which is required to install pyproject.toml-based projects

Same problem when I: pip install numpy

on Android Termux app

are you sucess now ?

@FranciscoJJimenezH
Copy link

Could not build wheels for numpy, which is required to install pyproject.toml-based projects

Same problem when I: pip install numpy

on Android Termux app

are you sucess now ?

Same problem here with termux Android app

@romanovj
Copy link

@FranciscoJJimenezH

pkg install python make llvm binutils-is-llvm  libandroid-execinfo -y
CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31" MATHLIB=m pip install numpy==VERSION

@rominamir
Copy link

rominamir commented Aug 18, 2023 via email

@FranciscoJJimenezH
Copy link

@FranciscoJJimenezH

pkg install python make llvm binutils-is-llvm  libandroid-execinfo -y
CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31" MATHLIB=m pip install numpy==VERSION

I worked for me, thanks man

@FranciscoJJimenezH
Copy link

@FranciscoJJimenezH

pkg install python make llvm binutils-is-llvm  libandroid-execinfo -y
CFLAGS+=" -U__ANDROID_API__ -D__ANDROID_API__=31" MATHLIB=m pip install numpy==VERSION

U think it will work to install pandas?

@romanovj
Copy link

romanovj commented Aug 18, 2023

@FranciscoJJimenezH
did you try python-pandas from tur-repo?

python-pandas/tur-packages 2.0.3 aarch64
Powerful Python data analysis toolkit

pkg i tur-repo
pkg i python-pandas

@skyriver1
Copy link

If the installation fails, it is most likely due to a problem with the python and numpy equivalents
python3.8 - numpy 1.17-1.19

@monksy
Copy link

monksy commented Jan 17, 2024

So I got this to work via pyenv.

So commands run to do this:

pyenv install 3.8
pyenv local 3.8
pyenv exec pip install pipx
pyenv exec pipx install scanprep
~/.local/bin/scanprep
 ~/.local/bin/scanprep --page-separation --blank-removal ~/test2.pdf clearedpdf.pdf

You probably do not need pipx. This is working with Python 3.8.18.

@pandeydeepak0
Copy link

I was facing a similar issue with GitHub codespaces, downgrading Python worked. numpy 1.26.2 is working with Python 3.10.8 - 2.10.13

@es-abdalrhman
Copy link

I used python 3.8.0 and numpy==1.22.0 . It worked for me

I agree that downgrading python version and installing numpy will work

@NikitaaSharma
Copy link

I used python 3.8.0 and numpy==1.22.0 . It worked for me

+1, it worked!!!!

@ntshvicky
Copy link

So I got this to work via pyenv.

So commands run to do this:

pyenv install 3.8
pyenv local 3.8
pyenv exec pip install pipx
pyenv exec pipx install scanprep
~/.local/bin/scanprep
 ~/.local/bin/scanprep --page-separation --blank-removal ~/test2.pdf clearedpdf.pdf

You probably do not need pipx. This is working with Python 3.8.18.

This work in my mac m1 pro processor.. dont buy mac, ban it..not working anything as developer

@DonaldRR
Copy link

Try downgrade the Python version. I tried Python3.8, 3.10 with the same error, while 3.6 works for me.

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

No branches or pull requests