【发布时间】:2022-12-06 09:08:10
【问题描述】:
我正在尝试使用 %%scalene 在 Jupyter 的 .ipynb fily 中运行 Scalene 并收到以下错误:
Scalene: An exception of type UnicodeEncodeError occurred. Arguments:
('charmap', '\r\n<html>\r\n <head>\r\n <title>Scalene</title> ...
其次是基本上整个 Scalene Github 网站 html 代码并以:
Traceback (most recent call last):
File "C:\Users\marci\anaconda3\envs\wc2022v2_env\lib\site-packages\scalene\scalene_profiler.py", line 1949, in run_profiler
exit_status = profiler.profile_code(
File "C:\Users\marci\anaconda3\envs\wc2022v2_env\lib\site-packages\scalene\scalene_profiler.py", line 1781, in profile_code
Scalene.generate_html(profile_fname=Scalene.__profile_filename, output_fname=Scalene.__profiler_html)
File "C:\Users\marci\anaconda3\envs\wc2022v2_env\lib\site-packages\scalene\scalene_profiler.py", line 1729, in generate_html
f.write(rendered_content)
File "C:\Users\marci\anaconda3\envs\wc2022v2_env\lib\encodings\cp1250.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\xa3' in position 79534: character maps to <undefined>
我认为是网站编码导致此错误是否正确?还是浏览器?
如果还有什么:可以做些什么呢?
蟒蛇 3.8.15
【问题讨论】:
标签: python jupyter-notebook profiler