Single-walled carbon nanotubes (SWCNTs) are functionalized with a spiropyran derivative, which is attached non-covalently to the SWCNT's sidewall via a pyrene anchor group. Using this non-covalent functionalization strategy, individual SWCNTs can be stabilized in solution without the need for additional surfactants. Bright luminescence confirms the presence of individual tubes in the thus-prepared samples. In these samples, the majority of pyrene-spiropyran molecules are attached to the walls of the SWCNTs. Upon complex formation with the SWCNT, the switching moiety retains its ability to switch, i.e., to undergo reversible transformations between the closed spiropyran and the opened merocyanine form, and is stable over many cycles of operation.