Installation issue when using M1 Chip
See original GitHub issueHi,
Has anyone experienced issues when trying to run python3 install_requirements.py
in Big Sur OS.
Seems like the problem is related to the numpy library. However, I was able to install numpy through home brew and did not get the same error.
Happened on Big Sur running on a M1 chip
Here is the error log:
Requirement already satisfied: pip in /opt/homebrew/lib/python3.9/site-packages (20.3.3) WARNING: Skipping depthai as it is not installed. Ignoring open3d: markers ‘platform_machine != “armv7l” and python_version < “3.9”’ don’t match your environment Collecting argcomplete==1.12.1 Using cached argcomplete-1.12.1-py2.py3-none-any.whl (38 kB) Collecting depthai==0.4.0.0 Using cached depthai-0.4.0.0.tar.gz (84 kB) Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … done Collecting numpy==1.19.3 Using cached numpy-1.19.3.zip (7.3 MB) Installing build dependencies … done Getting requirements to build wheel … done Preparing wheel metadata … error ERROR: Command errored out with exit status 1: command: /opt/homebrew/opt/python@3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp60t7dj_s cwd: /private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651 Complete output (217 lines): Running from numpy source directory. setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates run_build = parse_setuppy_commands() 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 blas_opt_info: blas_mkl_info: customize UnixCCompiler libraries mkl_rt not found in [‘/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib’, ‘/usr/local/lib’, ‘/usr/lib’, ‘/opt/local/lib’] NOT AVAILABLE
blis_info:
libraries blis not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
accelerate_info:
libraries accelerate not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
Library accelerate was not found. Ignoring
libraries veclib not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
Library veclib was not found. Ignoring
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
non-existing path in 'numpy/distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
openblas_clapack_info:
libraries openblas,lapack not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
flame_info:
libraries flame not found in ['/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib', '/usr/local/lib', '/usr/lib', '/opt/local/lib']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries tatlas,tatlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries tatlas,tatlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries tatlas,tatlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries tatlas,tatlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries lapack_atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries satlas,satlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries satlas,satlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries satlas,satlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries satlas,satlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries ptf77blas,ptcblas,atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries ptf77blas,ptcblas,atlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries lapack_atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries f77blas,cblas,atlas not found in /opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib
libraries lapack_atlas not found in /usr/local/lib
libraries f77blas,cblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/lib
libraries f77blas,cblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /opt/local/lib
libraries f77blas,cblas,atlas not found in /opt/local/lib
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running dist_info
running build_src
build_src
building py_modules sources
creating build
creating build/src.macosx-11-arm64-3.9
creating build/src.macosx-11-arm64-3.9/numpy
creating build/src.macosx-11-arm64-3.9/numpy/distutils
building library "npymath" sources
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 157, in prepare_metadata_for_build_wheel
self.run_setup()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 248, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 508, in <module>
setup_package()
File "setup.py", line 500, in setup_package
setup(**metadata)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-build-env-5br9n7ar/overlay/lib/python3.9/site-packages/setuptools/command/dist_info.py", line 31, in run
egg_info.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/egg_info.py", line 24, in run
self.run_command("build_src")
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 144, in run
self.build_sources()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 155, in build_sources
self.build_library_sources(*libname_info)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 288, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/build_src.py", line 378, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 658, in get_mathlib_info
st = config_cmd.try_link('int main(void) { return 0;}')
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/command/config.py", line 241, in try_link
self._check_compiler()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/command/config.py", line 80, in _check_compiler
self.fcompiler = new_fcompiler(compiler=self.fcompiler,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 880, in new_fcompiler
compiler = get_default_fcompiler(plat, requiref90=requiref90,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 851, in get_default_fcompiler
compiler_type = _find_existing_fcompiler(matching_compiler_types,
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 802, in _find_existing_fcompiler
c.customize(dist)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 526, in customize
linker_so_flags = self.flag_vars.linker_so
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/environment.py", line 37, in __getattr__
return self._get_var(name, conf_desc)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/environment.py", line 53, in _get_var
var = self._hook_handler(name, hook)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/__init__.py", line 705, in _environment_hook
return hook()
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/gnu.py", line 346, in get_flags_linker_so
flags = GnuFCompiler.get_flags_linker_so(self)
File "/private/var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/pip-install-tomzolhy/numpy_92985193da7a427c82dd73d9d6d03651/numpy/distutils/fcompiler/gnu.py", line 136, in get_flags_linker_so
os.environ['MACOSX_DEPLOYMENT_TARGET'] = target
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 684, in __setitem__
value = self.encodevalue(value)
File "/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/os.py", line 756, in encode
raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not int
----------------------------------------
ERROR: Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/45/h1sx4z4164v9hqc36ryjvvfm0000gn/T/tmp60t7dj_s Check the logs for full command output. Traceback (most recent call last): File “/Users/sebastianvillalobos/Sabana Tech/smartaccess/depthai/install_requirements.py”, line 17, in <module> subprocess.check_call([*pip_install, “-r”, “requirements.txt”]) File “/opt/homebrew/Cellar/python@3.9/3.9.1_5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py”, line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command ‘[’/opt/homebrew/opt/python@3.9/bin/python3.9’, ‘-m’, ‘pip’, ‘install’, ‘–user’, ‘-r’, ‘requirements.txt’]’ returned non-zero exit status 1.
Issue Analytics
- State:
- Created 3 years ago
- Comments:34
Finally I was able to install all dependencies successfully and run the demo.
What ended up working was what @alex-luxonis suggested. Which was:
And if the problem persists, maybe even remove completely Homebrew, running in a native terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
–should remove it from /opt/homebrewarch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
–should remove it from /usr/localAnd then reinstall with this command under Rosetta:
sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
followed by closing and reopening the terminal.In addition to running this commands I had to manually delete the Homebrew directory in both locations.
Thank you both for taking the time and troubleshoot for a solution @Luxonis-Brandon @alex-luxonis
@esbasti So I erased and reinstalled Big Sur on my Mac M1, then did these:
Opened
Terminal
and executed this dependencies install script from our website: https://docs.luxonis.com/en/latest/pages/api/#installing-system-dependenciessudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
Then ranpython3 -m pip install depthai
and was greeted with the same situation you encountered: it downloaded the.tar.gz
and attempted the wheel build, failing.Opened another
Terminal
under Rosetta 2:Get Info
-> tickedOpen using Rosetta
. Then trying to open it prompted me to install Rosetta, and after that I was able to open it.python3 -m pip install depthai
and was prompted with the same situation and error.sudo curl -fL http://docs.luxonis.com/_static/install_dependencies.sh | bash
python3 -m pip install depthai
, still with no luck.brew install cmake
didn’t helped.Opened again
Terminal
under Rosetta 2:python3 -m pip install depthai
and at this point it worked as expected, downloading the_x86_64.whl
Next I cloned this repo, ran
python3 install_requirements.py
, thenpython3 depthai_demo.py
, all working well.I highlighted in bold the steps from above that I believe helped. Let us know how it goes on your side.