• DepthAI-v2
  • No module named 'depthai' - Jetson Nano install

Hi,

I just went through the install guide for the Jetson Nano. No probelms until I tried out one one the example scripts for the rgb camera on an OAK -D

cd ~
source depthai/bin/activate

The enivorment starts,

cd depthai-python/examples/ColorCamera
sudo python3 rgb_camera_control.py
Traceback 
    File "rgb_camera_control.py", line 39, in <module>
      import depthai as dai
ModuleNotFoundError: No module named 'depthai'

But when I pip list it shows up depthai 2.25.10

What am I missing here?

  • jakaskerl replied to this.
  • DrBwts sudo python3 rgb_camera_control.py

    You are running python as root user, which uses a different environment, hence the lack of depthai. Run it without sudo, it should work.

    Thanks,
    Jaka

    DrBwts sudo python3 rgb_camera_control.py

    You are running python as root user, which uses a different environment, hence the lack of depthai. Run it without sudo, it should work.

    Thanks,
    Jaka

    When I do that I get the following error, (which is why I thought I'd try sudo)

    Insufficient permissions to communicate with X_LINK-UNBOOTED device with name "1.2.3". Make sure udev rules are set
    
    RunTimeError: No available devices

    Hi @DrBwts
    Run

    echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' | sudo tee /etc/udev/rules.d/80-movidius.rules
    sudo udevadm control --reload-rules && sudo udevadm trigger
    5 months later

    When I try to run the python script through systemd service on jetson nano , showing core dumps , failed to start.
    which when manually run on the terminal works fine.
    How to fix?

      jakaskerl
      `[Unit]
      Description=Oak-1 camera capture
      After=network.target

      [Service]
      User=drone
      WorkingDirectory=/home/drone/Desktop/depthai-python
      ExecStart=/home/drone/Desktop/depthai-python/vecros/sample_script.sh
      Restart=on-failure
      Environment="PYTHONUNBUFFERED=1"
      StandardOutput=syslog
      StandardError=syslog

      [Install]
      WantedBy=multi-user.target

      `
      this is the service file.

        aviator_01
        Ensure you have proper permissions. What does sample_script.sh look like? Can you add output logs as well?

        Thanks,
        Jaka

          aviator_01
          Maybe try disabling the PYTHONUNBUFFERED and I/O since they might be causing segfaults in not handled.

          Thanks,
          Jaka

            jakaskerl
            tried, only with execStart, User, arguments in Service section, even then not working.
            tried different combinations.

              aviator_01
              Make sure correct environment is used. A segfault could be due to mismatch in packages (I have seen this in the past with numpy and opencv). Make sure you are not displaying the frames.

              Thanks,
              Jaka

                aviator_01
                Don't stream frames 🙂 The opencv does not know where to display these frames. This is purely a cv.imshow() issue. If you need results, you can pipe then to a log file and view them after/during runtime. That is the point of a systemd service.

                Thanks,
                Jaka

                  jakaskerl
                  Okay , I will try doing this.
                  Thanks & will connect if any issues persists again.