0

我正在尝试设置 ChirpSDK,但每次配置和运行代码时,都会出现以下错误:

  Traceback (most recent call last):
  File "test.py", line 3, in <module>
    chirp = ChirpSDK()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 395, in __init__
    self.read_chirprc(block)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 501, in read_chirprc
    raise IOError('Could not find a ~/.chirprc file')
OSError: Could not find a ~/.chirprc file
Exception ignored in: <function ChirpSDK.__del__ at 0x10fa31af0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 422, in __del__
    self.close()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/chirpsdk/chirpsdk.py", line 470, in close
    if self._sdk:
AttributeError: 'ChirpSDK' object has no attribute '_sdk'

我意识到错误是说我的 .chirprc 文件没有被识别,但我不知道如何解决这个问题。我在 /Users/username/ 路径中创建了一个 .chirprc 文件,并将其命名为 c.chirprc(正如 Chirp 入门文章所建议的那样),但我仍然收到此错误。我还缺少另一部分吗?我读错了说明吗?

谢谢

4

1 回答 1

0

Chirp 配置文件应该放在/Users/<username>/.chirprcmacOS 上。

如果您ls -l ~/.chirprc在终端中运行,您会得到任何结果吗?如果它没有显示这样的文件或目录,那么您没有正确创建该文件。

于 2020-02-04T10:31:39.843 回答