Common misconception. You generally want to grow cannabis in a "grow box" of some kind, because you need decent control over the light the plant receives (there's distinct vegetative/flowering phases for cannabis plants). In that case your enclosed box can ventilate through a carbon filter, which by most reports (see the countless threads on r/microgrowery for example) cuts the odors down to nothing, even late in the flowering phase.
You can do it outside as well, but typically a box is the best with regulated lighting, temperature and humidity.
I’m not sure I believe the carbon filter reduces the smell to nothing, in my experience it still stinks while running through an internal AND external carbon filter.
Visual guide: https://www.supergreenlab.com/guide/how-to-build-a-ikea-eket...