'Xcode swift iOS project gives "usr/bin/python no such file or directory" error when try to build project

I am experiencing the problem after the macOS 12.3 Monterey update. I get the following error when I want to run the project. There is a code looking for "/usr/bin/python" in the project, but I couldn't find which part of code/framework/script etc. is looking for that path in my project. There is no problem in the path "usr/local/bin/python", but my project gives the error that I cannot find the path to "usr/bin/python". When I looked there, "/usr/bin/python3" exist. Unfortunately, since it is the system folder, I cannot make any changes(add or remove files or links) in that folder.enter image description here



Solution 1:[1]

First you need to install python2. This can be done according to the guide

Then it is necessary in the file

{PATH_TO_PROJECT}/scripts/licenses/importLicensePods.py

replace the first line with #!/usr/bin/python to #!/usr/bin/local/python

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kerim Khasbulatov