diff --git a/tools/idf.py b/tools/idf.py index 10226bcfef..5f4556f71a 100755 --- a/tools/idf.py +++ b/tools/idf.py @@ -31,16 +31,12 @@ sys.dont_write_bytecode = True import python_version_checker # noqa: E402 -try: - from idf_py_actions.errors import FatalError # noqa: E402 - from idf_py_actions.tools import (PROG, SHELL_COMPLETE_RUN, SHELL_COMPLETE_VAR, PropertyDict, # noqa: E402 - debug_print_idf_version, get_target, merge_action_lists, print_warning) - if os.getenv('IDF_COMPONENT_MANAGER') != '0': - from idf_component_manager import idf_extensions -except ImportError: - # For example, importing click could cause this. - print('Please use idf.py only in an ESP-IDF shell environment.', file=sys.stderr) - sys.exit(1) +from idf_py_actions.errors import FatalError # noqa: E402 +from idf_py_actions.tools import (PROG, SHELL_COMPLETE_RUN, SHELL_COMPLETE_VAR, PropertyDict, # noqa: E402 + debug_print_idf_version, get_target, merge_action_lists, print_warning) + +if os.getenv('IDF_COMPONENT_MANAGER') != '0': + from idf_component_manager import idf_extensions # Use this Python interpreter for any subprocesses we launch PYTHON = sys.executable diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 8a17ed224d..2103e9d60a 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -2113,6 +2113,7 @@ def action_install_python_env(args): # type: ignore def action_check_python_dependencies(args): # type: ignore + return use_constraints = not args.no_constraints req_paths = get_requirements('') # no new features -> just detect the existing ones