Please check for spaces in your code.
I dont know much of your problem, but this may be useful to you and anyone that came looking for this answer, just like me. This is a compiled of commentaries given by Eva and Nash. The codes i made was with python 2.7 with QGIS 2.18 in Windows 8.1. Try it using the python console inside QGIS.
split vector layer separates a shapefile file in multiple ones, separating them by one atribute only. I dont know if that is what you want.
For running the functions, you are missing the parameters. You should do:
layer_name = 'my_shapefile_layer'
output_directory = 'C:\Users\Desktop\shapes'
atribute = 'id'
if you dont know what parameters the function has, just call:
if you like to use another function, look for it using: