conor-f / spotibar

Polybar plugin for Spotify
15 stars 2 forks source link

Can't start spotibar #9

Closed AuthFailed closed 3 years ago

AuthFailed commented 3 years ago

Steps to reproduce:

  1. Run python3 -m pip install spotibar
  2. Run spotibar --auth

Error I got: command not found: Spotibar

error

I'm already tried to rerun first command, got this: python3 -m pip install spotibar

conor-f commented 3 years ago

Hey @AuthFailed

Super strange, it seems to have found the package and installed what was necessary but it can't find the entry point. Any chance you just need to run source ~/.zshrc or open up a new terminal to find the new executable?

AuthFailed commented 3 years ago

@conor-f

I tried again run spotibar command, but nothing new. source ~/.zshrc doesnt help too.

conor-f commented 3 years ago

if you run python3 and then import spotibar does it import correctly or does it get a module not found error?

AuthFailed commented 3 years ago

if you run python3 and then import spotibar does it import correctly or does it get a module not found error?

Imported correctly. 2021-03-15_22-55

conor-f commented 3 years ago

Thanks @AuthFailed, I'll get this sorted this evening. Must be an issue with the setup.py and how it sets up the console script. Will get back to you shortly!

conor-f commented 3 years ago

Hey @AuthFailed this is super weird. I tried replicating this as closely as possible:

conor@Conor:~ $ python3.9 -m pip uninstall spotibar
Found existing installation: spotibar 0.2.0
Uninstalling spotibar-0.2.0:
  Would remove:
    /home/conor/.local/bin/spotibar
    /home/conor/.local/lib/python3.9/site-packages/spotibar-0.2.0.dist-info/*
    /home/conor/.local/lib/python3.9/site-packages/spotibar/*
Proceed (y/n)? y
  Successfully uninstalled spotibar-0.2.0
conor@Conor:~ $ spotibar --help                         
zsh: command not found: spotibar
conor@Conor:~ $ python3.9 -m pip install spotibar  
Looking in indexes: https://pypi.org/simple, https://conor:****@pip.******.com, https://pypi.python.org/simple
/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pip.******.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
/usr/share/python-wheels/urllib3-1.25.8-py2.py3-none-any.whl/urllib3/connectionpool.py:999: InsecureRequestWarning: Unverified HTTPS request is being made to host 'pip.******.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Processing ./.cache/pip/wheels/42/82/d5/22f9a8b8c3390d44e89a6f80cfe4ca6099626b0925e7d77da6/spotibar-0.2.0-py3-none-any.whl
Requirement already satisfied: pylast in ./.local/lib/python3.9/site-packages (from spotibar) (4.2.0)
Requirement already satisfied: spotipy in ./.local/lib/python3.9/site-packages (from spotibar) (2.17.1)
Requirement already satisfied: requests>=2.25.0 in ./.local/lib/python3.9/site-packages (from spotipy->spotibar) (2.25.1)
Requirement already satisfied: urllib3>=1.26.0 in ./.local/lib/python3.9/site-packages (from spotipy->spotibar) (1.26.4)
Requirement already satisfied: six>=1.15.0 in ./.local/lib/python3.9/site-packages (from spotipy->spotibar) (1.15.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests>=2.25.0->spotipy->spotibar) (2019.11.28)
Requirement already satisfied: idna<3,>=2.5 in /usr/lib/python3/dist-packages (from requests>=2.25.0->spotipy->spotibar) (2.8)
Requirement already satisfied: chardet<5,>=3.0.2 in /usr/lib/python3/dist-packages (from requests>=2.25.0->spotipy->spotibar) (3.0.4)
Installing collected packages: spotibar
Successfully installed spotibar-0.2.0
conor@Conor:~ $ spotibar --help
usage: spotibar [-h]
                [--get-currently-playing | --previous-track | --next-track | --toggle-playback | --add-track-to-monthly-playlist | --auth | --config-popup | --init]

Entrypoint for Spotify/Polybar integration.

optional arguments:
  -h, --help            show this help message and exit
  --get-currently-playing
  --previous-track
  --next-track
  --toggle-playback
  --add-track-to-monthly-playlist
  --auth
  --config-popup
  --init

tried with and without pip caching enabled, etc etc. Only difference I notice in pip output is that yours doesn't specify "building wheels for collected packages: spotibar..." towards the end of the output. I really don't have much idea of what to do apart from either trying an older version of pip (e.g. python3.8 -m pip install spotibar), trying with sudo or uninstalling and reinstalling!

AuthFailed commented 3 years ago

I just removed spotibar package and then run installation command with sudo: 2021-03-15_23-46

AuthFailed commented 3 years ago

Maybe problem in this line? Defaulting to user installation because normal site-packages is not writeable

AuthFailed commented 3 years ago

I think I got the problem: WARNING: The script spotibar is installed in '/home/authfailed/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

I don't know why, I don't know how. I only understood it because of this

conor-f commented 3 years ago

Well that should be a pretty simple fix - adding /home/authfailed/.local/bin to your PATH by adding export PATH=$PATH:/home/authfailed/.local/bin in your .zshrc?

AuthFailed commented 3 years ago

Well that should be a pretty simple fix - adding /home/authfailed/.local/bin to your PATH by adding export PATH=$PATH:/home/authfailed/.local/bin in your .zshrc?

Yep, already fixed. BUT! There are new error from this

conor-f commented 3 years ago

Sorry I don't see what the new error is? :)

AuthFailed commented 3 years ago

Sorry I don't see what the new error is? :)

ImportError: libtk8.6.so: cannot open shared object file: No such file or directory

I solved this problem by using pacman -S tk

AuthFailed commented 3 years ago

Oh, shit, I've already added bin to PATH 2021-03-16_12-14_1`

ls -l /bin/sh said that /bin/sh -> bash I logon in /bin/sh and tried to run spotibar and got no errors. 2021-03-16_12-34

conor-f commented 3 years ago

Could be because of how you start your polybar? Mine is started via a shell script loaded from my i3 config which has the shebang line of #!/bin/bash

AuthFailed commented 3 years ago

You was right My firstline in shell polybar scipt was #!/usr/bin/env bash. Now everything works correctly. But I did not find information in the readme that I was supposed to add http://127.0.0.1 as a REDIRECT URI in Spotify