About command "idf.py"

howudoingesp32
Posts: 1
Joined: Tue Feb 15, 2022 3:05 pm

About command "idf.py"

Postby howudoingesp32 » Tue Feb 15, 2022 3:25 pm

Today,Im gonna test my first program "hello_world" on esp32-s @ubuntu 20.04,but there's a trouble that confused me a lot : when i use the command "idf.py",whatever "idf.py build",or "idf.py set-target esp32",there always occured the ERROR "Permission denied",i don't know how to solve the problem,i need your help,thanks!
============================================================================================================
The error infomations are as follow:
============================================================================================================
Executing action: all (aliases: build)
Traceback (most recent call last):
File "/home/cfk/esp/esp-idf/tools/idf.py", line 812, in <module>
main()
File "/home/cfk/esp/esp-idf/tools/idf.py", line 730, in main
cli(sys.argv[1:], prog_name=PROG, complete_var='_IDF.PY_COMPLETE')
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1691, in invoke
return _process_result(rv)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 1628, in _process_result
value = ctx.invoke(self._result_callback, value, **ctx.params)
File "/home/cfk/.espressif/python_env/idf4.3_py3.8_env/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/cfk/esp/esp-idf/tools/idf.py", line 645, in execute_tasks
task(ctx, global_args, task.action_args)
File "/home/cfk/esp/esp-idf/tools/idf.py", line 226, in __call__
self.callback(self.name, context, global_args, **action_args)
File "/home/cfk/esp/esp-idf/tools/idf_py_actions/core_ext.py", line 23, in build_target
ensure_build_directory(args, ctx.info_name)
File "/home/cfk/esp/esp-idf/tools/idf_py_actions/tools.py", line 182, in ensure_build_directory
os.makedirs(build_dir)
File "/usr/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/cfk/esp/hello_world/build'

ESP_Sprite
Posts: 9985
Joined: Thu Nov 26, 2015 4:08 am

Re: About command "idf.py"

Postby ESP_Sprite » Wed Feb 16, 2022 3:16 am

PermissionError: [Errno 13] Permission denied: '/home/cfk/esp/hello_world/build'
Can the user that you run idf.py as write to that directory? If not, did you create it as root or something? Can you do a 'ls -l' in the esp directory?

teddysaigon
Posts: 2
Joined: Sun Oct 23, 2022 1:26 pm

Re: About command "idf.py"

Postby teddysaigon » Sun Oct 23, 2022 1:28 pm

I faced the same issue :-(
I tried "su" to proceed the command line as root user, but still it appear "permission denied"

teddysaigon
Posts: 2
Joined: Sun Oct 23, 2022 1:26 pm

Re: About command "idf.py"

Postby teddysaigon » Sun Oct 23, 2022 1:41 pm

finally I can launch the scripts using this way :D

sudo python3 <path_to_the_folder>/vendors/espressif/esp-idf/tools/idf.py build

for example: in my case, it run with this below command line.
sudo python3 /Users/Admin/Documents/EMBEDDED/workspace_AWS/FreeRTOS/vendors/espressif/esp-idf/tools/idf.py -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 build

Sunbelt57
Posts: 10
Joined: Wed Feb 12, 2025 5:41 pm
Location: Eastern Wyoming

Re: About command "idf.py"

Postby Sunbelt57 » Sun Feb 23, 2025 9:30 am

I just now had the same error show up when going thru the 'getting started guide' at the end of the . ./export.sh script. I went into the tools directory and saw all the *.py files did not have the executable bits set. I did a 'chmod +x idf.py and the export.sh worked. I'm just now wondering if I should set those other py files as executable. Just wondering. I will continue with the installation process.

chegewara
Posts: 2463
Joined: Wed Jun 14, 2017 9:00 pm

Re: About command "idf.py"

Postby chegewara » Mon Feb 24, 2025 2:29 am

The only .py file which should be executable is install.py.
export.py is not executable, because you do not use it straight, you should

Code: Select all

source ./export.sh
or
. ./export.sh
It is also described in the docs.

Who is online

Users browsing this forum: Google [Bot] and 118 guests