0

I am trying to set up the ChirpSDK, but every time I configure and run the code, I get this error:

  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'

I realize that the error is saying that my .chirprc file is not being recognized, but I have no idea how to remedy this. I created a .chirprc file in my /Users/username/ path, and named it c.chirprc (as the Chirp getting started article suggests), but I am still getting this error. Is there another part that I am missing? Am I reading the instructions wrong?

Thanks

zami seck
  • 11
  • 2

1 Answers1

0

The Chirp configuration file should be placed at /Users/<username>/.chirprc on macOS.

If you run ls -l ~/.chirprc in the terminal, do you get any results? If it displays no such file or directory then you have not created the file correctly.

joextodd
  • 694
  • 4
  • 9
  • when I run that command, I get this result: -rw-r--r--@ 1 zamiseck staff 2740 Feb 4 05:50 /Users/zamiseck/.chirprc. However, the error still occurs if I attempt to run a script with the SDK. – zami seck Feb 04 '20 at 10:57
  • That looks good to me. Are you positive that it is still an `IOError` and not an issue with parsing the file? – joextodd Feb 04 '20 at 13:42
  • I believe so. The two that I can see within the terminal when I run a program are: raise IOError('Could not find a ~/.chirprc file') error and AttributeError: 'ChirpSDK' object has no attribute '_sdk'. – zami seck Feb 04 '20 at 18:06
  • If you run `whoami` in the terminal, does it say `zamiseck`? If you are running the script as a different user, ie. root (sudo) then you also need to place the .chirprc file in that user's directory as well. – joextodd Feb 05 '20 at 15:30