Python Forum
keep getting 'encoding' error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
keep getting 'encoding' error
#6
Do you use Python 3.6 as i posted link to?
# coding=utf-8 is not needed in Python 3 as it's use utf-8 as default encoding.
Here a example:
hello.py saved in folder C:\foo\hello.py
print("Hello World")
Start cmd:
Microsoft Windows [Version 10.0.16299.248]
(c) 2017 Microsoft Corporation. Med enerett.

C:\WINDOWS\system32>cd\

# Test python version
C:\>python -V
Python 3.6.4

# Test pip
C:\>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

# Run with path to file
C:\>python C:/foo/hello.py
Hello World

# Navigate to foo folder and run
C:\>cd foo
C:\foo>python hello.py
Hello World

C:\foo>
If this doesn't work try saving hello.py with and other editor.
To make sure that that editor you use don't mess up with byte order mark (BOM).
Reply


Messages In This Thread
keep getting 'encoding' error - by harry1948 - Feb-14-2018, 05:16 PM
RE: keep getting 'encoding' error - by buran - Feb-14-2018, 06:47 PM
RE: keep getting 'encoding' error - by snippsat - Feb-14-2018, 07:10 PM
RE: keep getting 'encoding' error - by harry1948 - Feb-16-2018, 04:21 PM
RE: keep getting 'encoding' error - by sparkz_alot - Feb-16-2018, 05:01 PM
RE: keep getting 'encoding' error - by snippsat - Feb-16-2018, 05:13 PM
RE: keep getting 'encoding' error - by harry1948 - Feb-18-2018, 03:38 PM
RE: keep getting 'encoding' error - by snippsat - Feb-18-2018, 04:22 PM
RE: keep getting 'encoding' error - by harry1948 - Feb-23-2018, 01:15 PM
RE: keep getting 'encoding' error - by sparkz_alot - Feb-23-2018, 02:01 PM
RE: keep getting 'encoding' error - by harry1948 - Mar-23-2018, 06:02 PM
RE: keep getting 'encoding' error - by snippsat - Mar-23-2018, 07:09 PM
RE: keep getting 'encoding' error - by harry1948 - Apr-13-2018, 04:59 PM
RE: keep getting 'encoding' error - by snippsat - Apr-13-2018, 05:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error notification after encoding robertje1024 1 1,316 May-29-2022, 04:18 PM
Last Post: Axel_Erfurt
  Encoding Error Racer_x 7 2,857 Nov-05-2021, 07:27 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020