I am getting this stack trace when I start pyramid pserve:
% python $(which pserve) ../etc/development.ini
Traceback
I had the same issue. I solved it by running the command in a different python version. I tried python3 filename.py
. Earlier i was using Python 2.7.
Another possibility is that the file from which something is imported may contain BOM (Byte Order Mark). It can be solved by opening the file in some editor which supports multiple encoding like VSCode (Notepad++) and saving in a different encoding statndard like ANSI, UTF-8(without BOM).