Setup help with rpi5 and setup_env

up and running on a rpi5- cannot get source setup_env.sh to work. somewhat of a newbie to some of this- appreciate the help. here is the error i get.
artyface@raspberrypi:/hailo-rpi5-examples $ source setup_env.sh
Setting up the environment…
Setting up the environment for hailo-tappas-core…
TAPPAS_VERSION is 3.29.1. Proceeding…
You are not in the venv_hailo_rpi5_examples virtual environment.
Virtual environment exists. Activating…
bash: source: /hailo-rpi5-examples/venv_hailo_rpi5_examples/bin/activate: is a directory
TAPPAS_POST_PROC_DIR set to /usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes
HailoRT warning: Cannot create log file hailort.log! Please check the directory . write permissions.
DEVICE_ARCHITECTURE is set to: HAILO8L
artyface@raspberrypi:/hailo-rpi5-examples $

Hey @pfefferprogram,

Welcome to the Hailo Community! I see you’re having some issues with your setup. Let’s address them step by step:

  1. First, let’s make sure your virtual environment is set up correctly:

    python3 -m venv venv_hailo_rpi5_examples
    source venv_hailo_rpi5_examples/bin/activate
    

    This will create the virtual environment if it doesn’t exist and activate it.

  2. Now, let’s fix the write permissions for the log file:

    sudo chmod +w /hailo-rpi5-examples
    sudo source setup_env.sh
    

    This should give you the necessary permissions and set up your environment.

After applying these fixes, try running your script again. If you run into any more problems, don’t hesitate to reach out. We’re here to help!

Best regards,
Omri

Thank you- i completed both steps, however am still not getting setup_env.sh to complete. if i run it with sudo i get an error as well. i really appreciate the help!

Could you please verify if you can enter the virtual environment by running:

source ./venv_dir/bin/activate

Also, please check if you can execute the following command:

chmod 777 setup_env.sh

If this doesn’t help you , can you please share the error you are facing when trying to activate the env.

When I type the first command I get:

artyface@raspberrypi:/hailo-rpi5-examples $ source ./venv_dir/bin/activate

bash: ./venv_dir/bin/activate: No such file or directory

the chmod command results:

artyface@raspberrypi:/hailo-rpi5-examples $ chmod 777 setup_env.sh

chmod: changing permissions of ‘setup_env.sh’: Operation not permitted

running chmod with sudo results in no error.

Sudo source fails entirely.

Hey @pfefferprogram

Can you please check out the install.sh file provided for easier installation .

also please run the

sudo chmod 777 setup_env.sh

Is that file provided or do I need to download it?

it’s in the repo GitHub - hailo-ai/hailo-rpi5-examples

artyface@raspberrypi:/hailo-rpi5-examples $ sudo chmod 777 setup_env.sh

artyface@raspberrypi:/hailo-rpi5-examples $ . setup_env.sh

Setting up the environment…

Setting up the environment for hailo-tappas-core…

TAPPAS_VERSION is 3.29.1. Proceeding…

You are not in the venv_hailo_rpi5_examples virtual environment.

Virtual environment exists. Activating…

bash: source: /hailo-rpi5-examples/venv_hailo_rpi5_examples/bin/activate: is a directory

TAPPAS_POST_PROC_DIR set to /usr/lib/aarch64-linux-gnu/hailo/tappas/post_processes

HailoRT warning: Cannot create log file hailort.log! Please check the directory . write permissions.

DEVICE_ARCHITECTURE is set to: HAILO8L

artyface@raspberrypi:/hailo-rpi5-examples $

Hi @pfefferprogram,

As mentioned in previous posts, the error is caused by permission issues, due to the path you cloned the repository to.
I suggest the following:

  • If there are no specific reasons to have the folder at /hailo-rpi5-examples, you can clone the repo to a different path, e.g. ~/hailo-rpi5-examples, where you have the right permissions

  • If you want to keep the repository at /hailo-rpi5-examples, please change the ownership of the folder recursively, or give permissions to the entire folder (similar to what has been suggested by @omria ).

    To change ownership recursively:

    sudo chown -R $(whoami):$(whoami) /hailo-rpi5-examples
    

    Alternatively, to give permissions recursively:

    sudo chmod -R 777 /hailo-rpi5-examples
    

Please clone a clean repository before testing the suggested solutions.

Thank you- this finally worked. It was not clear in the original instructions where to start the git clone. (or I missed it)