mirror of
https://github.com/Aran404/SpotAPI.git
synced 2026-04-25 16:55:50 +03:00
[GH-ISSUE #30] Installation of spotapi does not install some required packages #18
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SpotAPI#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @svioletg on GitHub (May 5, 2025).
Original GitHub issue: https://github.com/Aran404/SpotAPI/issues/30
After running
pip install spotapiand attempting to test with justimport spotapiin the interpreter, I kept encountering a number ofModuleNotFoundErrors; they were forpymongo,redis, thenwebsockets. I see in spotapi's setup.py these are specified as extras, but if they're supposed to be optional I would assume Just importing spotapi on its own shouldn't require them. Either that, or they should just be put in the regular requirements section. I would've just made a pull request for this but in case they are separate for a reason I decided to just open an issue for now.@Aran404 commented on GitHub (May 5, 2025):
I believe this is because you are importing the module from the init.py file which collects all the different classes into one file and this includes those modules aswell. Correct me if I'm wrong but if you directly imported the module instead of calling the init.py file, you won't need to install those packages. For example, from spotapi.playlist import ...
@svioletg commented on GitHub (May 5, 2025):
It seems to still require them regardless of what modules are imported from it, e.g. these are from inside venv that I only ran
pip install spotapiin:@Aran404 commented on GitHub (May 6, 2025):
If I'm being honest I have no clue
@Erriez commented on GitHub (May 7, 2025):
These packages are missing in requirements.txt after a clone of this repo and installing from
requirements.txt:Workaround: activate virtualenv, then install the packages manually:
@Aran404 commented on GitHub (May 7, 2025):
I think he wants a way to use the package without installing the "optional" requirements. I'm not very experienced with this stuff so I'm unsure as to how you get around this import issue.
@svioletg commented on GitHub (May 7, 2025):
I don't personally mind having these packages installed, I more wanted to point out that in practice they seem required for any functionality of the SpotAPI, therefore having them not installed by default might create some confusion. I'm not deeply familiar with your dev workflow for this project so I wouldn't know where to start making suggestions for how to avoid needing them, but if you didn't want to do that and just make it so they are required I believe you could modify this section of your
setup.pylike so:...to...
@Aran404 commented on GitHub (May 7, 2025):
Of course but I had some developers tell me to make them optional seeing that they aren't needed unless you use certain parts of SpotAPI (Savers) but I'll see if there's any work around.
@svioletg commented on GitHub (May 8, 2025):
I can see in spotapi's
__init__.pythere's these two lines:from spotapi.utils.saver import *,from spotapi.websocket import *. The same exists inutils/__init__.py, meaning no matter what you import, those modules with the optional dependencies are always imported. Personally, unless there's a reason for doing so that I'm unaware of, I would just recommend to remove allfrom x import *lines from both files, as from my testing the library seems to work just fine without them - aside from some slightly changed importing on the user side, e.g.from spotapi import Songwould have to change tofrom spotapi.song import Song. If you'd like I can do some further testing with this change and make a pull request for it.@Aran404 commented on GitHub (May 9, 2025):
My goal with that was that instead of importing the saver classes from the saver files, you could just import it straight from SpotAPI. I'll look into and see if that's a feasible solution. Thank you for help.