Custom integraton setup newbie

Hi, Although I have a lot of programming experience, I am a totally newbie on both python and integration development for home assistant.

I would like to create a custom component/integration, but am a little bit stuck on setting up my project. I have created a devcontainer and now want to start with the instructions on Creating your first integration | Home Assistant Developer Docs.

I tried to run the “python3 -m script.scaffold integration” command, but first i got told to be in the project root. So my second attempt to try that in the /workspaces/hacore/homeassistant/components folder. Is this correct?

After running this command again in that folder, I get the following error:

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/workspaces/hacore/homeassistant/components/script/__init__.py", line 5, in <module>
    import asyncio
  File "/usr/local/lib/python3.11/asyncio/__init__.py", line 8, in <module>
    from .base_events import *
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 23, in <module>
    import socket
  File "/usr/local/lib/python3.11/socket.py", line 54, in <module>
    import os, sys, io, selectors
  File "/usr/local/lib/python3.11/selectors.py", line 12, in <module>
    import select
  File "/workspaces/hacore/homeassistant/components/select/__init__.py", line 5, in <module>
    from datetime import timedelta
  File "/workspaces/hacore/homeassistant/components/datetime/__init__.py", line 5, in <module>
    from datetime import datetime, timedelta, timezone
ImportError: cannot import name 'datetime' from partially initialized module 'datetime' (most likely due to a circular import) (/workspaces/hacore/homeassistant/components/datetime/__init__.py)

Did I forgot something? Who can help me out to start my integration from a basic template?

Thanks

Your hacore folder would be the project root folder

Thanks, but that folder does not exists in the dev container.

In any other folder than the components folder, I get the message that I should be in the root. But in the components folder, I get the error from my begin topic