LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

EXE UnicodeDecodeError

Hello:

     I was able to run the vi program on my development computer, but there was an error when I ran it as an exe. The error is as follows,

code 1671

error:<class'UnicodeDecodeError'>

'utf-8'codec can't decode byte 0xb1 in position 49:invalid start byte

Is there a configuration error? Any ideas on how to solve it?   

    Looking forward to your reply!

0 Kudos
Message 1 of 9
(1,294 Views)

Hi and Hallo!

 


@hallo77 wrote:

I was able to run the vi program on my development computer, but there was an error when I ran it as an exe. The error is as follows, code 1671


Which VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(1,282 Views)

Error out from Python node.I have solved it, thank you for your reply.

0 Kudos
Message 3 of 9
(1,273 Views)

Hi Sir,

 

Could you please tell me how did you solve the problem? I am getting the same error (1671) from Python Node and I cannot solve it. Thank you so much.

0 Kudos
Message 4 of 9
(1,070 Views)

Error 1671:

 

<class 'UnicodeDecodeError'> 
'utf-8' codec can't decode byte 0xe2 in position 67: invalid continuation byte

 

Does anyone have a solution?

0 Kudos
Message 5 of 9
(828 Views)

As I've just solved the same/similar error and this thread has no posted solution i thought I should share.

 

The error i recieved was:

"Python returned the following error: <class 'UnicodeDecodeError'>
'utf-8' codec can't decode byte 0xe4 in position 34: invalid continuation byte"

 

Check the path for and remove non-standard characters. In my case, I had an 'ä' present at position 34 in the path string to my .py-file. Changing the path to eliminate such characters made the error go away and the vi ran properly.

0 Kudos
Message 6 of 9
(593 Views)

Yes, in my case, I had a folder named "H:\My Drive\CENT 35\Año 2025," and the Spanish character 'ñ' caused the same issue mentioned. I have now changed it to "H:\My Drive\CENT 35\Anio 2025," which in Spanish sounds very similar to the original 'ñ'. Now my VI module with Python is working fine.
One observation: this error only occurs in LabVIEW; in a pure Python environment, having a folder with the 'ñ' character is not a problem.

0 Kudos
Message 7 of 9
(384 Views)

@rntaboada

One observation: this error only occurs in LabVIEW; in a pure Python environment, having a folder with the 'ñ' character is not a problem.


That’s because Python uses Unicode strings while LabVIEW uses 8-bit local strings. Something between how LabVIEW converts its strings to  a Python string and how Python interprets it seems off. Have you your Windows locale set to something else than Spanish? Or customized the codepage settings specifically?

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 9
(372 Views)

Hi Rolf. My Develop computer has Windows in Spanish, I have checked the code page with the chcp command and it gives me that it has code page 850 (Multilingual (Latin I)). It does not have any extra settings beyond the one I mention here.
I have experienced this problem of unique Spanish characters when using Python with Windows before, and I always end up solving it by adjusting the names of the folders that contain the .py file.

0 Kudos
Message 9 of 9
(335 Views)