A driver without a licence who got behind the wheel while under the influence of cannabis has been sent to prison.