我将atom用作我在python中编写的小型计算脚本的小型IDE编辑器。为了执行这些脚本,我在Atom内使用了一个名为氢气的程序包。
不幸的是,我只有在尝试在Atom中运行脚本时才对以下错误感到困惑。在终端python(macosx)中单独运行这些行,效果很好。这是迷你脚本和产生的错误:
from psychrochart.chart import PsychroChart
import matplotlib.pyplot as plt
PsychroChart().plot(ax=plt.gca())
plt.show()
-----------------------------------------------------
----------------------
UnicodeDecodeError Traceback
(most recent call last)
<ipython-input-11-a557c799c767> in <module>()
2 import matplotlib.pyplot as plt
3
----> 4 PsychroChart().plot(ax=plt.gca())
5 plt.show()
/anaconda3/lib/python3.6/site-
packages/psychrochart/chart.py in __init__(self,
styles, zones_file, logger, verbose)
373 self._handlers_annotations = [] #
type: List
374
--> 375 self._make_chart_data(styles,
zones_file)
376
377 def __repr__(self) -> str:
/anaconda3/lib/python3.6/site-
packages/psychrochart/chart.py in
_make_chart_data(self, styles, zones_file)
393 """Generate the data to plot the
psychrometric chart."""
394 # Get styling
--> 395 config = load_config(styles)
396 self.d_config = config
397 self.temp_step =
config['limits'['step_temp']
/anaconda3/lib/python3.6/site-
packages/psychrochart/util.py in load_config(styles,
verbose)
96 return _load_config(
97 styles,
default_config_file=DEFAULT_CHART_CONFIG_FILE,
---> 98 verbose=verbose)
99
100
/anaconda3/lib/python3.6/site-
packages/psychrochart/util.py in
_load_config(new_config, default_config_file,
verbose)
71 if default_config_file is not None:
72 with open(default_config_file) as f:
---> 73 config = json.load(f)
74 else:
75 config = None
/anaconda3/lib/python3.6/json/__init__.py in load(fp,
cls, object_hook, parse_float, parse_int,
parse_constant, object_pairs_hook, **kw)
294
295 """
--> 296 return loads(fp.read(),
297 cls=cls, object_hook=object_hook,
298 parse_float=parse_float,
parse_int=parse_int,
/anaconda3/lib/python3.6/encodings/ascii.py in
decode(self, input, final)
24 class
IncrementalDecoder(codecs.IncrementalDecoder):
25 def decode(self, input, final=False):
---> 26 return codecs.ascii_decode(input,
self.errors)[0]
27
28 class
StreamWriter(Codec,codecs.StreamWriter):
UnicodeDecodeError: 'ascii' codec can't decode byte
0xc2 in position 131: ordinal not in range(128)