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.
Visual guide: https://www.supergreenlab.com/guide/how-to-build-a-ikea-eket...