Error: "ascii" codec can´t encode character n'lxe2'

I’m just starting to use cellprofiler and when I run the module “load image” it shows an error: “ascii” codec can´t encode character n’lxe2’ in position 10: ordinal not in range (128)
A friend of mine also has the same problem when he uses windows 8 with his pipelines, but when using windows 7, everything goes well.

Can you explain me what is hapening and how to solve this problem?

Thanks :wink:


Take a look at the FAQ entry on this issue. If it doesn’t help, please post back here so we can investigate further.


I did like in FAQ for windows, went to registery and erase the value data of default image directory. The error remains:

Traceback (most recent call last):
File “cellprofiler\pipeline.pyc”, line 309, in run
File “cellprofiler\modules\loadimages.pyc”, line 2125, in run
File “cellprofiler\measurements.pyc”, line 258, in add_image_measurement
File “cellprofiler\measurements.pyc”, line 320, in add_measurement

The pipelines works, however I’m not sure the results are correct, because I have to click “continue processing” in the error window.

pipeline_teste.cp (4.39 KB)


did you find any solution ?..



This is also an error that we have seen occur when the default input or output folders contains non-ASCII characters, e.g., non-English characters with accents over them such as listed here: If you can insure that the paths to your folders do not have such characters but are still getting this error, then let us know.


you are right.
it worked!

Good to hear! I’ve updated the FAQ entry accordingly.


I’ve stumbled upon a similiar problem:
Traceback (most recent call last):
File “cellprofiler\gui\pipelinecontroller.pyc”, line 2249, in do_analyze_images
File “cellprofiler\analysis.pyc”, line 115, in start
File “cellprofiler\analysis.pyc”, line 254, in start
File “cellprofiler\analysis.pyc”, line 780, in start_workers
File “subprocess.pyc”, line 672, in init
File “subprocess.pyc”, line 882, in _execute_child
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u017c’ in position 117: ordinal not in range(128)

In this case it was CellProfiler plugins directory that needed to change. I think this case should be added to the solution in FAQ.
Does the same problem applies to all the paths provided to CellProfiler?

Thanks for pointing this out, and will confirm if we protect against it. I’ll add it to the FAQ and I opened a bug report to check into it: … ssues/1265

I believe that paths provided via the Images module should work fine, though the paths may look ugly when output.