1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【encoding Error】python (SyntaxError: Non-ASCII character '\xe3' in file python.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details)

Posted at

#はじめに
python初心者がぐぐりながら、色々やっていたら初歩的なエラーがでたので忘備録として残しておきます。

#今回出たエラー

SyntaxError: Non-ASCII character '\xe3' in file python.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
スクリーンショット 2021-02-05 10.31.55.png

#私のpython version
$ python -V
Python 2.7.17

#対処方法
こちらのコードを行頭に記述。
$ # -- coding: utf-8 --

python3系をつかっていればおこらない?みたいです。

割と楽に対処できるエラーでよかった

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?