简体   繁体   中英

Unicode error in python 3.5 conda while implementing RenderTree function

I am using anytree package for creating tree.

udo = Node("Udo")
marc = Node("Marc", parent=udo)
print(RenderTree(udo))

While using RenderTree function, I am getting unicode error as below:

Traceback (most recent call last): File "C:\\Users\\Neelakshi\\workspace\\LogisticRegression\\TypeHierarchyTest.py", line 16, in print(RenderTree(udo)) File "C:\\Miniconda3\\envs\\Python35\\lib\\encodings\\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 14-16: character maps to

I have seen similar threads for this issue but could not find solution for it. I am running this sample program from eclipse and not from command line. Following are package details :

python: 3.5.1
conda: 4.3.24

I resolved this issue by changing Eclipse encoding settings to Utf-8. It was cp1252 before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM