Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Cannot import #2

Closed
l0ner opened this issue Jan 12, 2019 · 4 comments
Closed

Cannot import #2

l0ner opened this issue Jan 12, 2019 · 4 comments
Assignees

Comments

@l0ner
Copy link

l0ner commented Jan 12, 2019

Hi!

So, I'm trying to use this library, byt apparentely I cannot use it in python3.5 as i cannot import it. The error is:

Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> import spotify
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/spotify/__init__.py", line 7, in <module>
    from .models import *
  File "/usr/local/lib/python3.5/dist-packages/spotify/models/__init__.py", line 7, in <module>
    from .playlist import Playlist
  File "/usr/local/lib/python3.5/dist-packages/spotify/models/playlist.py", line 29
    yield PlaylistTrack(self.__client, track)
    ^
SyntaxError: 'yield' inside async function

Any way to bypass this?

@l0ner l0ner changed the title Canno import Cannot import Jan 12, 2019
@mental32 mental32 self-assigned this Jan 13, 2019
@mental32
Copy link
Owner

Ah this is my fault, When I added the new playlist track async iterator I forgot to change the python requires on setup.py.

The library is now 3.6+ anything less isn't supported. Although I may make the whole library 2to3 compatible in the future right now this isn't in the works.

Simply put the fix for that is use Python 3.6+ not 3.5 @l0ner

@l0ner
Copy link
Author

l0ner commented Jan 14, 2019

ok, reasonable

But what if my distro doesn't provide python3.6 (debian-stable and raspbian provides only 2.7 and 3.5). I'm not keen on installing python on debian from source or external repos. Could be there a workaround to make it work with 3.5?

@mental32
Copy link
Owner

I have revised some of the code in the playlist.py, this should remove the 3.6 dependency. Install the new version (0.2.0) and try it out If there are any issues let me know

@l0ner
Copy link
Author

l0ner commented Jan 19, 2019

Now it works!

Thanks for the quick fix.

Repository owner locked as resolved and limited conversation to collaborators Mar 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants