Linked Questions
16 questions linked to/from UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 13: ordinal not in range(128)
1409 votes
27 answers
2.5m views
How can I read a text file into a string variable and strip newlines?
I have a text file that looks like: ABC DEF How can I read the file into a single-line string without newlines, in this case creating a string 'ABCDEF'? For reading the file into a list of lines, ...
520 votes
20 answers
1.3m views
How to fix: "UnicodeDecodeError: 'ascii' codec can't decode byte"
as3:~/ngokevin-site# nano content/blog/20140114_test-chinese.mkd as3:~/ngokevin-site# wok Traceback (most recent call last): File "/usr/local/bin/wok", line 4, in Engine() File "...
3 votes
4 answers
4k views
Google Cloud SDK install failed UnicodeDecodeError: 'ascii' codec
I got the following error when installing the Google Cloud SDK on my Windows 10 computer: ERROR: gcloud failed to load: 'ascii' codec can't decode byte 0xe1 in position 13: ordinal not in range(128) ...
1 vote
1 answer
4k views
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128)
I'm working on scraping Oregon Teacher License data for a project I'm doing. Here's my code: educ_employ = tree.xpath('//tr[15]//td[@bgcolor="#A9EDFC"]//text()') print educ_employ #[u'Jefferson ...
1 vote
1 answer
2k views
Python Unicode and ASCII issues when parsing HTML
I am trying to write a Python script which acts similar to Ctrl + S on a Chrome web browser, it saves the HTML page, downloads any links on the webpage and finally, replaces the URIs of the links with ...
0 votes
2 answers
1k views
UnicodeDecodeerror with pip install pyodbc
Trying to install pyodbc: pip install pyodbc it got the following error. I install a different item peewee specifically and it install without giving me error. I further tried with pip install pymssql ...
0 votes
1 answer
1k views
UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 284: ordinal not in range(128) [duplicate]
from textblob import TextBlob as tb from sqlalchemy import create_engine import pandas as pd first i had created engine using sqlalchemy as engine=create_engine("mysql+mysqldb://root:ja@localhost:3306/...
1 vote
2 answers
1k views
how to visualise results in Spyder?
I was trying to read a txt file in python. After the following input: f = open("test.txt","r") #opens file with name of "test.txt" print(f.read(1)) print(f.read()) instead of looking at the text I'm ...
2 votes
3 answers
1k views
how to replace non ascii char in python
I need to replace non ASCII char like ¾ in Python but I get SyntaxError: Non-ASCII character '\xc2' in file test.py but no encoding declared; see http://www.python.org/peps/pep-0263.html for details` ...
1 vote
2 answers
1k views
How to fix UnicodeDecodeError in Python (Django Rest Framework template)?
I'm running a Django web app and creating a REST Api using Django Rest Framework. I've created a basic list/update view however when I go to the url, I get 'A server error occurred. Please contact ...
2 votes
1 answer
581 views
UnicodeDecodeError: 'utf-8'/'ascii' codec can't decode byte 0xe2 in position 31
I have an input csv file and when I try to do some operations on it and make an output file, I am getting this error. At first I got the 'utf-8' Error so I searched and checked the encoding of my file ...
0 votes
1 answer
444 views
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 10: ordinal not in range(128) While reading DATA FROM DB2 Table
getting the error while reading data from DB2 table using PYTHON 3.x. UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 10: ordinal not in range(128)
0 votes
2 answers
372 views
UnicodeDecodeError when instaling new package
I am trying to install a package that I have used many times with python 2.7 and ubuntu 14.04, however it fails now with following error: Cleaning up… Exception: Traceback (most recent call last): ...
0 votes
1 answer
254 views
django ascii error code UnicodeDecodeError my query contains some arabic character
I deployed my Django project that uses Apache and MySQL. all apps features work fine, but in an application's views.py, when I try to access it, it raises this error. UnicodeDecodeError: 'ascii' codec ...
0 votes
0 answers
301 views
Python 'ascii' codec can't encode character u'\u2013' in position 151: ordinal not in range(128) AWS Glue
I have a Python script that is running in AWS Glue. Up until last month is was working fine and I ran into the following error. I've seen several different nasty hacks suggested on SO and am having ...