pyahmed / PyCORN

A script to extract data from ÄKTA/UNICORN result-files (.res)
47 stars 26 forks source link

Problems in execution - UnicodeEncodeError #20

Closed Faby-ch closed 6 years ago

Faby-ch commented 6 years ago

Hi This is so useful script but unfortunately I have problems in run. The "sample" archive run without problems but when I put my own UNICORN archive I receive this message:

File "C:\Program Files\Python36\Scripts\pycorn-bin.py", line 308, in data_writer1 dp = str(x) + sep + str(y) + str('\r\n') UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 49: ordinal not in range(128)

I use windows 10 and I probed the execution in python 2.7.13 and 3.6.0

Thanks a lot for the help!

pyahmed commented 6 years ago

Hi,

thanks - most likely has to do with some funky char within the log. I thought those problems were fixed some time ago but seems I was wrong. Can you post/send the file?

Faby-ch commented 6 years ago

Hi! Sure, I can post the file here. Thanks!

2018sep.01 OctaV1 IE.zip

pyahmed commented 6 years ago

I just tried it with Python3/Win7-64, didn't trigger any error. I might try in a Win10 VM in the next couple of days.

Which Python version are you using, 2 or 3?

Faby-ch commented 6 years ago

I probed with the two in Windows 10 (2.7.13 and 3.6.0). Now, I try in python 2.7.13 in Ubuntu and have the same problem. Maybe I need to add other things in python in addition to the two libraries?

pyahmed commented 6 years ago

Couldn't really reproduce it on Win10/64 with Python 3.6.

Maybe I need to add other things in python in addition to the two libraries?

For plotting, installing matplotlib should pull in all the required dependencies. You will need xlsxwriter if you want to write xlsx files.

Faby-ch commented 6 years ago

Today I tried again to extract my files. And now I can do! I don't know what is the diferent becuse I diden't install finally matplotlib and only run the scrip with xlsxwriter that I had previously installed. Thanks so much for the aswers and for this script!

pyahmed commented 6 years ago

Thanks - good to hear 👍