Couldn't complie any ESPHome yaml

Could you please help me in the following issue?

I couldn’t compile any of my ESPHome yamls. These have worked up till now. The current version of the HA is 2021.2.3. I get the following error message when I click to the compile button:

INFO Reading configuration /config/esphome/basementlamp.yaml...
INFO Generating C++ source...
INFO Compiling app...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 11, in <module>
    load_entry_point('esphome', 'console_scripts', 'esphome')()
  File "/opt/esphome/esphome/__main__.py", line 557, in main
    return run_esphome(sys.argv)
  File "/opt/esphome/esphome/__main__.py", line 544, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
  File "/opt/esphome/esphome/__main__.py", line 286, in command_compile
    exit_code = compile_program(args, config)
  File "/opt/esphome/esphome/__main__.py", line 149, in compile_program
    return platformio_api.run_compile(config, CORE.verbose)
  File "/opt/esphome/esphome/platformio_api.py", line 94, in run_compile
    return run_platformio_cli_run(config, verbose)
  File "/opt/esphome/esphome/platformio_api.py", line 90, in run_platformio_cli_run
    return run_platformio_cli(*command, **kwargs)
  File "/opt/esphome/esphome/platformio_api.py", line 79, in run_platformio_cli
    import platformio.__main__
  File "/usr/local/lib/python3.6/dist-packages/platformio/__main__.py", line 21, in <module>
    from platformio import __version__, exception, maintenance, util
  File "/usr/local/lib/python3.6/dist-packages/platformio/maintenance.py", line 22, in <module>
    from platformio import __version__, app, exception, fs, telemetry
  File "/usr/local/lib/python3.6/dist-packages/platformio/app.py", line 29, in <module>
    from platformio.project.helpers import get_default_projects_dir, get_project_core_dir
ImportError: cannot import name 'get_default_projects_dir'