Reputation: 1180
I'm trying to use python with Vim. When I create a .py file and try to execute it using the .<FileName>, I get the following error:
line 2 ~
|SyntaxError: Non-UTF-8 code starting with '\xe1' in file C:\Users\Nilton Schum~
|acher F\Desktop\Udemy Python\recebendo_dados_usuario.py on line 3, but no enco~
|ding declared; see http://python.org/dev/peps/pep-0263/ for details
This is how my test.py file looks:
"""
This are notes
"""
print("Whats your name?")
Upvotes: 1
Views: 192
Reputation: 71
Just wondering whether you've set the encoding in your vimrc to utf-8, if not try adding a line to ~/.vimrc
of set encoding=utf-8
. This is solely based on the error message, if the error changes, comment below!
EDIT: Actually it seems you're on Windows, I have no clue where the vimrc would be here, but I'm sure this is easy enough to find!
Upvotes: 1