cancel
Showing results for 
Search instead for 
Did you mean: 

Cant Build Matter Device With The Instructions of Google

prophemusx
Community Member

https://developers.home.google.com/codelabs/matter-device?hl=en&authuser=0#6 as it is shown in the website I did reboot my computer with Ubuntu. Then configured the port of my ESP32-WROOM-32D device and tried whether or not I can upload something into it. So that I could see if the computer can reach my device through USB port. I successfully uploaded. Afterwards I downloaded Google Home app on my android phone then managed my Google Home Mini 2.nd Gen device and did connect Home Mini without a problem. After these steps, I began to write all the codes that have been instructed us to the Terminal one by one but then I realized that  ESP-IDF version was not the latest. I have already installed ESP-IDF's latest version before from the ESPRESSIF's website, maybe because of that I got the following error;


Installing virtualenv
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
  File "/home/celiker/esp-idf_tools/esp-idf/tools/idf_tools.py", line 1567, in action_install_python_env
    import virtualenv  # noqa: F401
    ^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'virtualenv'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/celiker/esp-idf_tools/esp-idf/tools/idf_tools.py", line 1970, in <module>
    main(sys.argv[1:])
  File "/home/celiker/esp-idf_tools/esp-idf/tools/idf_tools.py", line 1966, in main
    action_func(args)
  File "/home/celiker/esp-idf_tools/esp-idf/tools/idf_tools.py", line 1570, in action_install_python_env
    subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--user', 'virtualenv'],
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', 'install', '--user', 'virtualenv']' returned non-zero exit status 1.

1 Recommended Answer

sipriyadarshi
Solutions Expert
Solutions Expert

Hello @prophemusx ,

Thanks for reaching out with your issue. You can refer to the following github link in regards to your subprocess.CalledProcessError. Try running the following command ' sudo apt install python3-virtualenv ' to install the latest version of the python3 virtual environment and then give again a try to setup up your own Matter Supported Smart Home Device. 

View Recommended Answer in original post

8 REPLIES 8

prophemusx
Community Member

I also tried ESPRESSIF's instructions before this one, so I already downloaded the latest version of ESP-IDF and did run it without a problem.

I am not sure if the error above can cause problem in the future. Then I went to the next step and did clone the connectedhomeip from github. Next, in the section Set up the Matter SDK after writing

git checkout FETCH_HEAD

code to my terminal, I am getting the following output which (I guess) tells me there is no problem.

Not: Şuraya geçiliyor: 'FETCH_HEAD'.

Şu anda 'ayrık HEAD' durumundasınız. Oraya buraya bakabilir, deneysel
değişiklikler yapıp gönderebilir veya başka bir dala geçerek yaptığınız
tüm işlemeleri başka hiçbir dala etki etmeden geri alabilirsiniz.

Yaptığınız işlemeleri korumak için yeni bir dal oluşturmak isterseniz bunu
şimdi veya daha sonra switch komutuna -c ekleyerek yapabilirsiniz. Örnek:

    git switch -c <yeni-dal-adı>

Bu işlemi şununla geri alabilirsiniz:

    git switch -

Bu öğüdü advice.detachedHead yapılandırma değişkenini false yaparak
kapatabilirsiniz.

HEAD konumu: 9bd53e85d9 Create SPECIFICATION_VERSION

These outputs are in Turkish and it says all good.

Untill the 3rd step of Set up the Matter SDK, I got no errors or something like that. But, in the 3rd step

source ./scripts/bootstrap.sh

I got this output
(pages of output, I can't put them all here but I'll put the errors here.)
I am getting Matter logo and its letters on the screen which are big enough and beneath it it says;
BOOTSTRAP! Bootstrap may take a few minutes; please be patient.
Downloading and installing packages into local source directory:


still installs and collects requirements and then ;

Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
['/home/celiker/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/celiker/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/celiker/connectedhomeip/scripts/requirements.txt', '--constraint=/home/celiker/connectedhomeip/scripts/constraints.txt'] {'stdout': <_io.TextIOWrapper name=3 mode='w+' encoding='UTF-8'>, 'stderr': -2}

None
Traceback (most recent call last):
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 795, in <module>
sys.exit(main())
^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 787, in main
return EnvSetup(**vars(parse())).setup()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 457, in setup
result = step(spin)
^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 606, in virtualenv
if not virtualenv_setup.install(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 274, in install
pip_install('--log', os.path.join(venv_path, 'pip-requirements.log'),
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 243, in pip_install
return _check_call(cmd)
^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 88, in _check_call
subprocess.check_call(args, **kwargs)
File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/celiker/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/celiker/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/celiker/connectedhomeip/scripts/requirements.txt', '--constraint=/home/celiker/connectedhomeip/scripts/constraints.txt']' returned non-zero exit status 1.

I did the next Google steps and build it then passed to the Configure the Build section. In the very first step, I began to get the error. When I type

source ./scripts/activate.sh

to the terminal, I got the following output

Matter logo and bootstrap again...

Using cached gevent-1.5.0.tar.gz (5.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
['/home/celiker/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/celiker/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/celiker/connectedhomeip/scripts/requirements.txt', '--constraint=/home/celiker/connectedhomeip/scripts/constraints.txt'] {'stdout': <_io.TextIOWrapper name=3 mode='w+' encoding='UTF-8'>, 'stderr': -2}

None
Traceback (most recent call last):
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 795, in <module>
sys.exit(main())
^^^^^^

File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 787, in main
return EnvSetup(**vars(parse())).setup()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 457, in setup
result = step(spin)
^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 606, in virtualenv
if not virtualenv_setup.install(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 274, in install
pip_install('--log', os.path.join(venv_path, 'pip-requirements.log'),
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 243, in pip_install
return _check_call(cmd)
^^^^^^^^^^^^^^^^
File "/home/celiker/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 88, in _check_call
subprocess.check_call(args, **kwargs)
File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/celiker/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/celiker/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/celiker/connectedhomeip/scripts/requirements.txt', '--constraint=/home/celiker/connectedhomeip/scripts/constraints.txt']' returned non-zero exit status 1.


I can not make my own Matter Supported Smart Home Device with Google Steps. Any help would be appreciated.

-Mustafa

We appreciate you contacting us with this concern. About your subprocess, you can consult the github link provided below.Error Called Process. To install the most recent version of the Python 3 virtual environment, try executing the following command: "sudo apt install python3-virtualenv." Then, try setting up your own Matter Supported Smart Home Device once more.

sipriyadarshi
Solutions Expert
Solutions Expert

Hello @prophemusx ,

Thanks for reaching out with your issue. You can refer to the following github link in regards to your subprocess.CalledProcessError. Try running the following command ' sudo apt install python3-virtualenv ' to install the latest version of the python3 virtual environment and then give again a try to setup up your own Matter Supported Smart Home Device. 

Hello sir, i got the same error but i use 'sudo apt install python3-virtualenv' and got lastest version of python3 and try again but it still got the same error.

Collecting gevent<2.0,>=1.2.2 (from gdbgui==0.13.2.0->-r /home/phuongnt/Matter/connectedhomeip/scripts/requirements.esp32.txt (line 5))
Using cached gevent-1.5.0.tar.gz (5.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Getting requirements to build wheel: finished with status 'error'
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
['/home/phuongnt/Matter/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/phuongnt/Matter/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/phuongnt/Matter/connectedhomeip/scripts/requirements.txt', '--constraint=/home/phuongnt/Matter/connectedhomeip/scripts/constraints.txt'] {'stdout': <_io.TextIOWrapper name=3 mode='w+' encoding='UTF-8'>, 'stderr': -2}

None
Traceback (most recent call last):
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 795, in <module>
sys.exit(main())
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 787, in main
return EnvSetup(**vars(parse())).setup()
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 457, in setup
result = step(spin)
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/env_setup.py", line 606, in virtualenv
if not virtualenv_setup.install(
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 274, in install
pip_install('--log', os.path.join(venv_path, 'pip-requirements.log'),
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 243, in pip_install
return _check_call(cmd)
File "/home/phuongnt/Matter/connectedhomeip/third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py", line 88, in _check_call
subprocess.check_call(args, **kwargs)
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/phuongnt/Matter/connectedhomeip/.environment/pigweed-venv/bin/python', '-m', 'pip', 'install', '--log', '/home/phuongnt/Matter/connectedhomeip/.environment/pigweed-venv/pip-requirements.log', '--requirement=/home/phuongnt/Matter/connectedhomeip/scripts/requirements.txt', '--constraint=/home/phuongnt/Matter/connectedhomeip/scripts/constraints.txt']' returned non-zero exit status 1.