Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm - SyntaxError: Non-UTF-8 code starting with '\x80'

enter image description here

I am trying to open project in PyCharm which includes simple

virtual environment(python 3) and test.py

after opening it in PyCharm I've configured python interpreter to virtual environments Python 3.

then after running it in PyCharm I get the following error:

SyntaxError: Non-UTF-8 code starting with '\x80' in file /home/ubuntu/Downloads/PythonDemo/PythonDemo/venv_3/bin/python3 on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

How to resolve this issue?

like image 697
tushar patil Avatar asked Nov 15 '17 18:11

tushar patil


Video Answer


2 Answers

What you have entered as Script: looks like a Python interpreter. You should put test.py there. Script parameters: are the additional parameters passed to the script on the command line, not the Python script to run.

like image 50
Adrian W Avatar answered Oct 09 '22 08:10

Adrian W


Be cognizant of that you have right script path. Your file name must be same in the path.

enter image description here

like image 33
snr Avatar answered Oct 09 '22 08:10

snr