• DepthAI-v2
  • Need help installing DepthAI on an M1 MacBook

Some context: I have had an OAK-D since they first came out. I was successful using it on an Intel-based MacBook, and a Raspberry Pi. Sadly, I had to replace the MacBook with an M1-based MacBook in early 2022. Despite days of trying, with a lot of help from Luxonis, I was never able to get DepthAI to work on the M1 MacBook. I am sure some of the reasons have to do with my modest familiarity with some tools like homebrew and git.

Today, I tried again to install the latest DepthAI on my M1 MacBook, as I was told several months ago it should should succeed. I used the instructions here. I entered the bash command, accepted the default install folder and Python 3.9.5. I got the following response:

This script requires Bash 4.0 or higher. You are using Bash 3.2.57(1)-release. Please upgrade your Bash version.

A bit of searching suggested that makes sense because macOS only comes with 3.2.57(1).

I next searched for ways to upgrade bash. One way suggesting using homebrew,and starting with the command "brew doctor". I got the following response, which confuses me, and I am reluctant to proceed without advice:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/gregflurry/.pyenv/shims/python3.9-config
  /Users/gregflurry/.pyenv/shims/python-config
  /Users/gregflurry/.pyenv/shims/python3-config

Warning: You are using macOS 14.
We do not provide support for this pre-release version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
pre-release version.


Warning: Ruby version 2.6.10 is unsupported on macOS 14. Homebrew
is developed and tested on Ruby 2.6.9, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.

Warning: Your Xcode is configured with an invalid path.
You should change it to the correct path:
  sudo xcode-select --switch /Applications/Xcode.app

I am not sure what to do about the Python stuff. I suspect the multiple scripts are an artifact of my futile attempts at installation in 2022.

I am on macOS 14.6.1, but macOS is certainly not pre-release, so I suspect the warning is bogus. Perhaps I need to update homebrew.

I don't have a clue what to do about the Ruby warning or Xcode warning.

Thanks for any assistance.

    gregflurry Please note that these warnings are just used to help the Homebrew maintainers
    with debugging if you file an issue. If everything you use Homebrew for is
    working fine: please don't worry or file an issue; just ignore this. Thanks!

    I wouldn't worry about this.


    It sounds like you're encountering several issues that need to be resolved before you can successfully install and use DepthAI on your M1 MacBook. Let's go through each issue step by step:

    1. Upgrade Bash

    macOS ships with an older version of Bash (3.2.x), but you need Bash 4.0 or higher. You can install a newer version using Homebrew.

    1. Install the latest Bash:

         brew install bash
    2. After installation, you need to add the new Bash to your list of shells:

         sudo bash -c 'echo /opt/homebrew/bin/bash >> /etc/shells'
    3. Then, change your default shell to the new Bash:

         chsh -s /opt/homebrew/bin/bash
    4. Restart your terminal to use the updated Bash.


    GPT on how to update bash. Once updated, proceed with the command. Let me know if you run into any issues. Since it's a common issue, it will probably be faster if you consult a GPT since the instructions they give for similar issues are usually spot on.

    Thanks,
    Jaka

      jakaskerl Thanks for the pointer. I tried your suggested approach and it did not work. 'bash --version' reported v3. I used GPT and it actually gave very similar instructions, but they were incorrect, possibly because I used homebrew to install bash. I tried setting the default shell in Terminal and in Apple settings. 'bash --version' reported v3. I finally found something that said put the path to the homebrew version in the shell’s configuration file. That got me to 'bash --version' reporting v5.

      So then I executed the install command again, and it failed. Once again I have no clue how to proceed.

      Gregorys-MBP:~ gregflurry$ bash -c "$(curl -fL https://docs.luxonis.com/install_depthai.sh)"
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   122  100   122    0     0    990      0 --:--:-- --:--:-- --:--:--   991
      100  7490  100  7490    0     0  25124      0 --:--:-- --:--:-- --:--:-- 25124
      mkdir: /Users/gregflurry/Luxonis: File exists
      
      ENTER absolute installation path for depthai or leave empty and default path: $HOME will be used.
      
      Using default installation path: /Users/gregflurry/Luxonis
      Directory: /Users/gregflurry/Luxonis is OK
      
      Python version: Python 3.9.5 found.
      If you want to use it for installation, press ENTER key, otherwise input path to python binary.
      Press ENTER key to continue
      _____________________________
      Calling macOS_installer.sh
      _____________________________
      Running macOS installer.
      Installing global dependencies.
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
      100   127  100   127    0     0   1020      0 --:--:-- --:--:-- --:--:--  1024
      100  8636  100  8636    0     0  30815      0 --:--:-- --:--:-- --:--:-- 30815
      Homebrew is already installed.
      Git Already installed..
      Finished installing global libraries.
      Downloading demo app.
      Cloning into '/Users/gregflurry/Luxonis/depthai'...
      remote: Enumerating objects: 21914, done.
      remote: Counting objects: 100% (62/62), done.
      remote: Compressing objects: 100% (37/37), done.
      remote: Total 21914 (delta 34), reused 47 (delta 25), pack-reused 21852 (from 1
      Receiving objects: 100% (21914/21914), 248.50 MiB | 2.72 MiB/s, done.
      Resolving deltas: 100% (14513/14513), done.
      Already on 'main'
      Your branch is up to date with 'origin/main'.
      Already up to date.
      Creating python virtual environment in /Users/gregflurry/Luxonis/venv
      /Users/gregflurry/.pyenv/shims/python3
      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
      Requirement already satisfied: pip in /Users/gregflurry/Luxonis/venv/lib/python3.9/site-packages (21.1.1)
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
      Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
      Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyqt5/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyqt5/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyqt5/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyqt5/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyqt5/
      Could not fetch URL https://pypi.org/simple/pyqt5/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyqt5/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      ERROR: Could not find a version that satisfies the requirement pyqt5 (from versions: none)
      ERROR: No matching distribution found for pyqt5
      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
      Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
      
      Failed installing depthai. Could be a bug in the installer or unsupported platform. Open a bug report over at https://github.com/luxonis/depthai - exited with status 1 at line 159

      Hi @gregflurry
      Are you using a proxy or firewall? Perhaps try updating the SSL certs for python.

      WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

      Thanks,
      Jaka

        jakaskerl This is so much fun.

        I did some more GPT stuff. I used homebrew to install openssl, but it was already there. I used homebrew to reinstall python3, and set up to make sure the newly installed Python was used. Using 'python3 -m ssl' think I verified that Python has access to ssl. This time, things got further:

        Gregorys-MBP:~ gregflurry$ 
        bash -c "$(curl -fL https://docs.luxonis.com/install_depthai.sh)"
          % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
        100   122  100   122    0     0    830      0 --:--:-- --:--:-- --:--:--   829
        100  7490  100  7490    0     0  16830      0 --:--:-- --:--:-- --:--:-- 16830
        mkdir: /Users/gregflurry/Luxonis: File exists
        
        ENTER absolute installation path for depthai or leave empty and default path: $HOME will be used.
        
        Using default installation path: /Users/gregflurry/Luxonis
        Directory: /Users/gregflurry/Luxonis is OK
        
        Python version: Python 3.12.5 found.
        If you want to use it for installation, press ENTER key, otherwise input path to python binary.
        Press ENTER key to continue
        _____________________________
        Calling macOS_installer.sh
        _____________________________
        Running macOS installer.
        Installing global dependencies.
          % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
        100   127  100   127    0     0   1101      0 --:--:-- --:--:-- --:--:--  1104
        100  8636  100  8636    0     0  28978      0 --:--:-- --:--:-- --:--:-- 28978
        Homebrew is already installed.
        Git Already installed..
        Finished installing global libraries.
        Demo app already downloaded. Checking out main and updating.
        remote: Enumerating objects: 8, done.
        remote: Counting objects: 100% (8/8), done.
        remote: Compressing objects: 100% (3/3), done.
        remote: Total 8 (delta 5), reused 7 (delta 5), pack-reused 0 (from 0)
        Unpacking objects: 100% (8/8), 1.68 KiB | 214.00 KiB/s, done.
        From https://github.com/luxonis/depthai
           6901f745..3fe8c58c  main       -> origin/main
        Already on 'main'
        Your branch is behind 'origin/main' by 2 commits, and can be fast-forwarded.
          (use "git pull" to update your local branch)
        Updating 6901f745..3fe8c58c
        Fast-forward
         depthai_sdk/src/depthai_sdk/trigger_action/trigger_action.py | 2 +-
         1 file changed, 1 insertion(+), 1 deletion(-)
        Creating python virtual environment in /Users/gregflurry/Luxonis/venv
        /opt/homebrew/bin/python3
        WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
        Requirement already satisfied: pip in /Users/gregflurry/Luxonis/venv/lib/python3.9/site-packages (21.1.1)
        WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
        WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
        WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
        WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
        WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pip/
        Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
        WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
        Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
        Collecting pyqt5
          Downloading PyQt5-5.15.11-cp38-abi3-macosx_11_0_arm64.whl.metadata (2.1 kB)
        Collecting PyQt5-sip<13,>=12.15 (from pyqt5)
          Downloading PyQt5_sip-12.15.0-cp312-cp312-macosx_10_9_universal2.whl.metadata (421 bytes)
        Collecting PyQt5-Qt5<5.16.0,>=5.15.2 (from pyqt5)
          Downloading PyQt5_Qt5-5.15.14-py3-none-macosx_11_0_arm64.whl.metadata (536 bytes)
        Downloading PyQt5-5.15.11-cp38-abi3-macosx_11_0_arm64.whl (6.6 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.6/6.6 MB 14.6 MB/s eta 0:00:00
        Downloading PyQt5_Qt5-5.15.14-py3-none-macosx_11_0_arm64.whl (36.7 MB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 36.7/36.7 MB 23.3 MB/s eta 0:00:00
        Downloading PyQt5_sip-12.15.0-cp312-cp312-macosx_10_9_universal2.whl (124 kB)
        Installing collected packages: PyQt5-Qt5, PyQt5-sip, pyqt5
        Successfully installed PyQt5-Qt5-5.15.14 PyQt5-sip-12.15.0 pyqt5-5.15.11
        Collecting packaging
          Downloading packaging-24.1-py3-none-any.whl.metadata (3.2 kB)
        Downloading packaging-24.1-py3-none-any.whl (53 kB)
        Installing collected packages: packaging
        Successfully installed packaging-24.1
        DepthAI has been added to your PATH in .bashrc and .zshrc (if present).
        If you prefer, you can manually add the following line to your .bash_profile for it to be recognized in login shells:
        export PATH=$PATH:/Users/gregflurry/Luxonis/depthai/entrypoint
        
        
        :::::::::::::::: INSTALATION COMPLETE ::::::::::::::::
        
        
        To run demo app write <depthai_launcher> in terminal.
        Press ENTER KEY to finish and run the demo app...
        
        STARTING DEMO APP.
        Traceback (most recent call last):
          File "/Users/gregflurry/Luxonis/depthai/launcher/launcher.py", line 11, in <module>
            from splash_screen import SplashScreen
          File "/Users/gregflurry/Luxonis/depthai/launcher/splash_screen.py", line 2, in <module>
            from PyQt5 import QtCore, QtGui, QtWidgets
        ModuleNotFoundError: No module named 'PyQt5'
        
        Failed installing depthai. Could be a bug in the installer or unsupported platform. Open a bug report over at https://github.com/luxonis/depthai - exited with status 1 at line 231 

        Note that the problems with pip and ssl continue. Also there is a problem with PyQt5. I have no idea what to do with the former (a.f.i.k. I have no proxy or firewall). I guess I could install PyQt5, but I'd assume the installer would install all dependencies. Basically, I remain clueless, and of course without a working OAK-D.

          gregflurry
          I know right, it rocks 😉

          Ok, so you managed to install depthai with the script. Looks like it might have installed packages in a different environment to what it used to open depthai demo.

          Generally on MacOS you don't even need to run these steps as it should work out-of-the-box.

          The script you ran basically only runs this in the background and installs brew and git:

          So now that the bash seems to be kinda working, you can try installing depthai manually in an environment of your own choice. To do so, clone luxonis/depthai-python and run python examples/install_requirements.py inside the environment you want. This should install everything you need.

          Let me know if you still experience any issues with openssl or anything else. python -m ssl should give you the installed version.

          Thanks,
          Jaka

            jakaskerl Thanks again for the help. I started to do what you suggested and I realized that my environment is likely configured wrong. I think I mentioned early in this thread that I tried getting things set up in 2022 and failed miserably. I cannot remember what I did much less why. I believe I'm running into some problems because of that history.

            Some examples: 'python --version' -> 3.9.5 which is the Python that homebrew installed back in 2022; 'python3 --version' -> "3.12.5", which is the Python that homebrew installed last week; 'python3 -m ssl' -> nothing, which I've read means everything is OK; 'python -m ssl' -> "Traceback ... in <module> import _ssl import _ssl ...", in other words bad stuff; 'pyenv versions' -> "system

            • 3.9.5 (set by /Users/gregflurry/.pyenv/version)"; the install appears to use 3.12.5, which might not be the right thing, but the pip WARNINGs mention Python3.9.

            I fear that with all that, I suspect need to fix my Python environment; I may or may not need to use pyenv. I am not really sure what of the proper configuration (3.9.5 or 3.12.5; use pyenv or not). Advice needed.

              gregflurry
              I'd suggest purging python3.9 from the system unless you absolutely need it. brew uninstall python@3.9, pyenv uninstall 3.9.5.

              Haven't used pyenv before but according to gpt, this should set both python(3) to point to python3.12
              Then check if you still have openssl issues.

              I'd recommend you use a virtual environments (python -m venv) if possible so libraries don't get tangled.

              Thanks,
              Jaka