Theoretical calculations have been achieved to study the interaction between the confined F-2 molecule along the nanotube axis and perpendicular to it and armchair (n,n) single-walled carbon nanotubes with n = 4, 5, 6, 7, and 8 and the zig-ag nanotube (9,0) using the density functional theory method with the CAM-B3LYP functional and both cc-pVQZ and STO-3G basis sets. The interaction of the F-2 molecule with the nanotube is different according to the molecular orientation, the chirality of the carbon nanotube, and the confinement space extension. These results interpreted by means of van der Waals interactions reveal anisotropic and competitive behavior at the nanometric level. The pi electrons of the nanotube interact with the lone pairs of F-2 highlighting its lateral polarizability. The encapsulated F-2 molecule is stable along and perpendicular to the nanotube (5,5) and (6,6) axis. The best stabilization energy is obtained fornanotube (5,5) at the perpendicular position using the cc-pVQZ basis set.