b4ird / spotify_sync

A schedulable, configurable CLI downloader for Spotify accounts
MIT License
181 stars 8 forks source link

JSONDecodeError? #20

Open nebb00 opened 1 year ago

nebb00 commented 1 year ago

spotify_sync run auto --config config.json Traceback (most recent call last): File "/home/pi/.local/bin/spotify_sync", line 8, in sys.exit(cli()) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/pi/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, **kwargs) File "/home/pi/.local/lib/python3.9/site-packages/spotify_sync/main.py", line 48, in auto app.auto() File "/home/pi/.local/lib/python3.9/site-packages/spotify_sync/cli.py", line 39, in auto from spotify_sync.match import MatchService File "/home/pi/.local/lib/python3.9/site-packages/spotify_sync/match.py", line 5, in from requests import JSONDecodeError ImportError: cannot import name 'JSONDecodeError' from 'requests' (/usr/lib/python3/dist-packages/requests/init.py)

jbh-cloud commented 1 year ago

Hi a little more context would be useful.

Could you shoot me your dependancy versions? python3.9 -m pip freeze | grep -E 'spot-sync|requests'

Is this an new issue / first time run?

jbh-cloud commented 1 year ago

@nebb00 okay I've worked it out. It seems that the projects desired version of requests is incorrectly set for the use of JSONDecodeError. This was introduced in requests 2.27.0 but the requirements allow from 2.25.1.

Check if this works for you in the interim:

python3.9 -m pip install requests==2.27.0

then

spotify_sync run auto --config config.json

I'll bump the version assuming it does.

ahhmino commented 1 year ago

Not the original reporter but this fixed it for me!