You need to run first 3 commands you wrote in a system console (e.g.: command prompt on Windows, Terminal on Linux), and the other 2 in a Python console. 'import' lines are Python code that get executed, other 3 lines are scripts your system executes.
Considering the returned error, I guess you attempted to execute all of them in Python console.
Considering the returned error, I guess you attempted to execute all of them in Python console.