title: Import a module from a subdirectory in FastAPI
body: <p>I have an api with a structure like this</p>
  
  <pre><code>my-api
  ├── Dockerfile
  ├── __init__.py
  ├── app
  │   ├── __init__.py
  │   ├── api
  │   │   ├── __init__.py
  │   │   └── mymodule.py
  │   ├── config.py
  │   ├── main.py
  │   └── requirements.txt
  └── docker-compose.yml
  </code></pre>
  
  <p>I'm trying to import mymodule.py into main.py per the <a href="https://fastapi.tiangolo.com/tutorial/bigger-applications/" rel="nofollow noreferrer">docs</a> but when I do so get the error</p>
  
  <pre><code>File "./app/main.py", line 3
  from my-api.app.api import allocate
         ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>My import looks like this</p>
  
  <pre><code>from my-api.app.api import mymodule
  </code></pre>
  
  <p>and my Dockerfile CMD is </p>
  
  <pre><code>CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7833"]
  </code></pre>
  
  <p>Is there something I'm doing wrong here?</p>