Can't login to spotify via libspotify on raspberry pi - spotify

I'm using libspotify 12.1.103.gd51f6226 Release Linux-armv6-bcm2708hardfp on my Raspberry Pi and I think that everything worked out alright with the instruction in the readme.
I changed out appkey.c for my appkey as given by spotify but when I run the spshell example and try to login, I get an error
FATAL, TERMINATING: failed to log in to Spotify: Cannot connect to Spotify
Logged out
Exiting...
I'm sure that I'm using the correct username (I also tried email) and password (I also tried changing the password) and I've tried the jukebox example as well and get a similar error. I'm able to log into the website and the windows app just fine.
The one place that I think that I might have gone wrong is:
After this, ensure your PKG_CONFIG_PATH is set tocd
include the libspotify control file, and that the lib directory is
in the library search path.
I'm pretty sure that I did that okay and I don't get any errors during the build.
Any ideas?

I had the exact same problem, which you can see from my comments on this question. For me it turned out to be a problem with my username which contains a non-ascii letter ö. But since my plan all along was to use pyspotify I managed to log in using their jukebox example and hardcoding my username where appropriate and adding the nice little u infront of it, and now I can login to spotify, see line ~460 in the jukebox example:
session_m = Jukebox(options.username, options.password, True)
Which i changed to this:
session_m = Jukebox(u"username_with_ö", options.password, True)
Now my problem is another which is that I can't access /dev/dsp but that is an entirerly different problem. :)
EDIT
apt-get install alsa-oss solve the above mentioned problem, my raspberry is now playing music!

I can compile and login.
What I did was to simply extract the tar.gz to
And then..
sudo apt-get install libasound2-dev libreadline-dev
cd <libspotify folder>/share/doc/libspotify/examples
vim appkey.c
And then add the application key that you generate. But that seemed to work for you.
make LIBSPOTIFY_PATH=../../../..
spshell/spshell
Then I can login and do a lot of things, I haven't tried any audio yet since I don't have any speakers/headphones available.
If you install it instead using
cd <libspotify folder>
make install prefix=/usr/local
as described in the README also run
sudo ldconfig
to update the library cache, and then just do a normal compile.
cd <libspotify folder>/share/doc/libspotify/examples
make
If you suspect that you have compiled stuff the wrong way, do a "make clean" first.
Don't know if this is to any help but that is how far I have come.

Related

Screen error: Can't locate local/lib.pm in #INC (you may need to install the local::lib module)

I'm new to linux coding and have just been given an account on a server at work. I don't have sudo permissions. For some unknown reason, the 'screen' program has suddenly stopped working. Every time I try to open a screen session I get the following error
Can't locate local/lib.pm in #INC (you may need to install the local::lib module) (#INC contains: /home/user/perl5/lib/perl5/x86_64-linux-thread-multi /home/user/perl5/lib/perl5 /home/user/miniconda3/lib/site_perl/5.26.2/x86_64-linux-thread-multi /home/user/miniconda3/lib/site_perl/5.26.2 /home/user/miniconda3/lib/5.26.2/x86_64-linux-thread-multi /home/user/miniconda3/lib/5.26.2 .).
BEGIN failed--compilation aborted.
I've tried opening up my .bash_profile and .bashrc to delete any lines referring to perl or the local::lib, and I don't have permissions to install the local::lib myself. I've tried navigating to the directories listed in the error message but they also don't exist. I also tried reinstalling perl and screen into a conda environment but screen needs to be activated before the environment so I just got the same message. Both perl and screen are still installed as I can print the version.
I have no idea why screen suddenly stopped working as I don't think I did anything, and it was working perfectly fine for the first few weeks. Any ideas/help would be much appreciated!
See #dave-mitchell's comments to what local::lib is, but as for how to solve the problem, you'll probably need to install local::lib yourself in your home directory. This does not require administrative access using the bootstrap method as outlined in the local::lib documentation:
https://metacpan.org/pod/local::lib#The-bootstrapping-technique
Following that, cpanminus (cpanminus) should be able to install most perl modules using the --local-lib option as needed.
However, if this is simply a problem with screen itself not working, and you don't care about perl modules per se, then I would recommend installing tmux as an alternative to screen which is also possible to do without administrative privileges (see this superuser question) and is widely considered to be a superior option

When I was downloaded “Pip”, I got an error

enter image description hereI am working object detection project. Firstly, i need to downloading “pip” and I did it. But i got an error(like in photo), and I haven’t any idea. How can i solve, do you have any idea?
You need to prefix your commands with sudo because they are meant to be run as root.
Example: sudo apt-get update.
Be careful when using sudo, you can really mess up a system as root.

Error building a script for linux

I'm trying to build a script for linux to help me each time I install linux from scratch.
The Script have to 1.- Add repositories 2.- Install software from those repositories.
Adding repositories are not the problem, the problem is when i try to install software from this repo.
For the Repo:
sudo add-apt-repository -y ppa:webupd8team/java
After that, the script should make an update, so:
sudo apt-get update
It looks simple, but is not, because I receive an error:
The command Update could not be found.
And so on the rest of the softwares
apt-get -y install oracle-java8-installer
The package oracle-java8-installer couldn't be found..
I really don't know what should I do, nothing looks to work, I gave full rigths to the file and so on... always the same error.
But if I run the command apt-get install direct from the terminal, works without problem..
Any help?
actually I wrote a script in windows to use it in future Linux installations, for some reasons it doesn't work as I want it. Thinking it was a command or misspelled words, I search for a solution, wich didn't help anyways.
Debugging my script in a virtual Machine, I found that the script was giving some random errors like '/r' doesn't support and like that. Really weird because after searching in my script for that line code I didn't find it.
With that in mind, I search again for those errors, and found that for some reasons, if you write your code in a Windows maschine, it save it in a crlf type, wich in a Linux system is interpreted really wrong.
A solution of some users was converting the type from CRLF to LF, wich in linux is using the command dos2unix.
dos2unix filename.sh
After making that and runing my script again everything works perfectly.

Building software from github on command line linux?

Apologies if the following isn't very clear and is very item specific, but I'm just very confused with what to do next and can't find any answers on google.
I am trying to install beschulz's WAV2PNG software on a Ubuntu server.
I've followed the directions on the page to get the required software :
apt-get install make g++ libsndfile1-dev libpng++-dev libpng12-dev libboost-program-options-dev
Which seems to have installed correctly, but next it's saying that I need to build it and I can't work out how to do this.
The docs say :
cd build
make all
Which i've tried but I just get :
-bash: cd: build: No such file or directory
This is the first time i've had to "build" anything after downloading it so any help would be greatly appreciated.
You are supposed to have performed a git clone on the Github repository.
you#vnix$ git clone https://github.com/beschulz/wav2png.git
.... stuff happens ...
you#vnix$ cd wav2png/build
you#vnix$ make all
... lots and lots of stuff happens ...
If this is your first time, things are likely to fail in interesting and/or intriguing ways. You probably want to make sure you are in an environment where you can scroll back and look at error messages and copy/paste them into Google or a new question (tmux, screen, and Emacs ansi-term are all popular alternatives, although a terminal with a big enough scrollback buffer and reasonable keyboard bindings to navigate it would be a good start already).

sudo dpkg -i mod-pagespeed-*.deb giving "not a debian format archive" error

The following apparently trivial two initial steps to install mod-pagespeed resulted in the error,
'mod-pagespeed-stable_current_amd64.deb' is not a debian format archive
even though the first (wget) step appeared to work properly.
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
sudo dpkg -i mod-pagespeed-*.deb
What might be going wrong and how to fix that?
In my case the .deb file was much smaller than expected and its content indicated that "this product is not available in your country," even though the server was meant to be in the UK, and https://www.countryipblocks.net/ agreed that it was in the UK. (http://whatismyipaddress.com/ip-lookup said it was in the US.)
The solution was simply to go to the Google download page for the module, https://developers.google.com/speed/pagespeed/module/download, do a local download (eg right click the appropriate link and do "Save link as ..." in Firefox), and then upload that to the server.
It then built fine.
(I found this solution in a comment about a different problem at http://www.turnkeylinux.org/forum/support/20120514/how-do-i-install-modpagespeed, which speculated that "server's IP was somehow mistraced by Google to some weird country or something" - could this be the underlying cause?)
Edit: Possible gotcha: Later problems with apt-get update with a GPG error (fatal) with the mod-pagespeed installation being the very smoky gun. It was a mess to sort out.

Resources