Error running L4-QnA cell number 5

Trying to run above notebook cell 5. Have installed docarray and restarted kernel.

index = VectorstoreIndexCreator(

Getting following error:

UnicodeDecodeError Traceback (most recent call last)
Cell In[5], line 3
1 index = VectorstoreIndexCreator(
2 vectorstore_cls=DocArrayInMemorySearch
----> 3 ).from_loaders([loader])

File ~\anaconda3\envs\openai\Lib\site-packages\langchain\indexes\, in VectorstoreIndexCreator.from_loaders(self, loaders)
79 docs =
80 for loader in loaders:
—> 81 docs.extend(loader.load())
82 return self.from_documents(docs)

File ~\anaconda3\envs\openai\Lib\site-packages\langchain\document_loaders\, in CSVLoader.load(self)
59 with open(self.file_path, newline=“”, encoding=self.encoding) as csvfile:
60 csv_reader = csv.DictReader(csvfile, **self.csv_args) # type: ignore
—> 61 for i, row in enumerate(csv_reader):
62 content = “\n”.join(f"{k.strip()}: {v.strip()}" for k, v in row.items())
63 try:

File ~\anaconda3\envs\openai\Lib\, in
108 if self.line_num == 0:
109 # Used only for its side effect.
110 self.fieldnames
→ 111 row = next(self.reader)
112 self.line_num = self.reader.line_num
114 # unlike the basic reader, we prefer not to return blanks,
115 # because we will typically wind up with a dict full of None
116 # values

File ~\anaconda3\envs\openai\Lib\encodings\, in IncrementalDecoder.decode(self, input, final)
22 def decode(self, input, final=False):
—> 23 return codecs.charmap_decode(input,self.errors,decoding_table)[0]

UnicodeDecodeError: ‘charmap’ codec can’t decode byte 0x9d in position 4445: character maps to

Please help

Hi @bolt,

Are you trying to run the notebook on the platform or elsewhere ?

At my local machine

Should I upgrade langchain? openai I upgrades last week

Updated langchain from 0.0.279 to 0.0.285
Updated openai from 0.27.8 to 0.28.0

The same error persists

The cell runs on other csv file like Data.csv from L3-chains.

So the problem is with the file OutdoorClothingCatalog_1000.csv. It seems same file running at the platform. So don’t know what to do

Hi @bolt,

Have your properly downloaded the file ? Maybe it is corrupt ?

Please make sure you have downloaded everything from the workspace by clicking on File --> Open.... This should open things in a new tab where your workspace, including all of the files will be visible to you.


Hi All,
to resolve this issue make the following change to the loader line:

loader = CSVLoader(file_path=file)
loader = CSVLoader(file_path=file, encoding=‘utf8’)

Hope that helps.


Thanks Chuck, I was facing the same issue!