Highlights of my current Touch Bar present

No, Spotipy is not downloaded, which is weird. I downloaded it from the GitHub link you sent, and have the files on my Mac.
I typed in 'pip install Spotipy' and it returned:
Last login: Tue May 26 07:56:36 on ttys000

samhumphreys@Ruths-MacBook-Pro ~ % pip install spotipy

zsh: command not found: pip

samhumphreys@Ruths-MacBook-Pro ~ %

================

when I compile the code, it says this:

when I press OK:

=================

when I typed in 'python PATH_TO_FILE', (I assume in Terminal?) it came back with this:
samhumphreys@Ruths-MacBook-Pro ~ % python /Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/BTT Presets/spotifywidgetcode.py

/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/samhumphreys/Library/Mobile': [Errno 2] No such file or directory

samhumphreys@Ruths-MacBook-Pro ~ %

===============

I tried the new terminal at folder thing:

I couldnt find it :frowning:

========================

thanks

Downloading and installing are two different things. You have to install it properly, so that Python recognise, that Spotipy is "there". I run a different version of macOS (Mojave). Regarding your terminal output, you are running Catalina. Apple changed a few things here. Try to follow this guide to install pip. Hopefully it will works with the command:

sudo easy_install pip

keep in mind that you are not the admin user. you can switch the account manually ( for example logging off with: cmd+ā‡§+Q and logging in with the other account) or you can witch the user in terminal by:

su ADMIN_USER_ACCOUNT_NAME

further information for running sudo command from non-admin account.

The problem occurs because of the spacebars in the path. That's why Documents is highlighted, it stops reading the line.
As I said before: AppleScript accept single quotes if you have spacebars in a path. Your AppleScript will look like this:

tell application "Spotify"
	set currentTrackID to id of current track as string
	set playlistID to "spotify:user:lowrents:playlist:5eCCewHsK1JZfHqz4CctrG" as string 
	
	tell application "Terminal"
		do script "python -i '/Users/samhumphreys/Library/Mobile Documents/com~apple~ScriptEditor2/Documents/spotify/test.py' " & playlistID & " " & currentTrackID & " " in window 1
		---do script "quit()" in window 1
		---delay 0.5
		---quit
	end tell
end tell

Also because of the spacebar, so the terminal stops reading after Mobile. Terminal should accept single and double quotes for paths.

python "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/BTT Presets/spotifywidgetcode.py"

or

python '/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/BTT Presets/spotifywidgetcode.py'

Keep in min that we want to test the python script. So if this (above) will work, you don't have to try the following "terminal at folder"-thing.

Please read properly above. You have to make sure that you selected the folder, not the file. Go one hierarchy back, select the folder and the option should appear. My default view in finder is "column view" so it will look a bit different:
image
image

Hopefully this will helps.

hi

Installing pip

I did what the link told me to do, and this happened. I guess I have to update python? how do I do that?

also, what will using the admin user do? can't i do this Spotify playlist in touchbar thing on my non-admin account?

Space

I added the singe quotes. I think I had put them in the wrong place before, but now they are in the right place. I compiled the script and it worked

Terminal Folder thing

I did what you said in your previous post:


im so lost :joy::sweat:

thanks

great! we are coming closer :smiley:

it seems that pip installed successfully. now you can try again to install spotipy.

pip install spotipy

double check if it's installed correctly by typing:
python -c 'help("modules")'

okay now that we know that the AppleScript is working, you can copy this in BTT.

Okay so we are now in the correct folder and can access the python script. The error you see above is because of the incorrect filetype (.rtf).
Now you can try the nano thing again.

sudo nano spotifywidget.py

If it doesn't work with sudo, try to use the command without sudo. We need a non-formatted file, which will nano creates.
Alternatively you can use a text editor (not the apple native one) like atom and create the python file.
If the python script is created try to run it by

python spotifywidget.py

keep in mind that you have to be in the folder BTT Presets

pip

I don't know what's happening.
I checked that pip was installed, and it came up when I wrote python -c 'help("modules")'
but when I ran pip install Spotipy, this showed:

sudo nano thing

I did the sudo nano spotipywidgetcode.py thing and it didn't worked. I then did it without the word sudo (nano spotipywidgetcode.py) and it came u with this:


has it worked?

Atom

I am currently using Atom for my python coding, so I tried python spotipywidgetcode.py and it returned:

thanks

Unfortunately I think I cannot help you at this point. Solving this problem remotely exceeds my capabilities since I am the only user on my MacBook. I cannot replicate "your" environment and test the same thing you have to do to get things running. Try using google to solve this problem.
I think it has something to do with the different users on the MacBook... an finally... a proper path ā€“ again :smiley: Try google the warning which is shown in your screenshot.

yep it works. A new file is created (which is shown in the bottom line). now you could paste the python script, safe the file and exit nano but I think we can skip this since you are using Atom for creating the python script. Atom and nano is kind of the same thing. Both are text editors which we want to use to create the python script.

Again, our pain in the neck... the path/ directory you are in. The path you are currently working in (with the terminal) is shown in the line:
samhumphreys@Ruths-MacBook-Pro FOLDER_YOUR_ARE_WORKING_IN %

If you take a look at your screenshot the ~ means that you are in your users home directory.
if you run python script.py the terminal tries to run the script you named (script.py) in the current directory you are in, but the script is in your "BTT Preset" folder.
So you have two possibilities: you can do the run-terminal-at-folder-thing again or you can define the hole path to you script.

python "/Users/samhumphreys/Library/Mobile Documents/com~apple~CloudDocs/2020/BTT Presets/spotifywidgetcode.py"

mind the double quotes! :smiley:

ok, sorry but so im not sure where we're at. can you no longer help me?

I am a bit confused as well and I think I was not born to write manuals. I can and will help you for sure :blush: especially since we gone this long way and many things are already working.
The only thing I can't help you with is the problem with pip/ spotipy, sorry for confusing you... and I think you have to use google for solving this. If spotipy is installed we can go further and get things working.

For your motivation:

ok that's sooo cool. what's our next step? I could probably make this account the admin account if that helps?

bump @lowrents

Hello again, sorry for not being this responsive. I am currently writing my master thesis and I realized that my time management failed a little bit. Deadline is in a few weeks :smiley:

Iā€™m not quite sure if this helps. If you have access to the other user on the MacBook you can test ist. But I think it has something to With the configuration of pip, to be more precise: with the correct path, regarding you Terminal output.

[quote="Future_Face, post:16, topic:7258"]

[/quote]

It look like python does not recognize the installed libraries (like spotipy) correctly. The easiest thing is to google this warning a try to solve it.

Have a look at this thread:

Hi.
I understand that you're writing your master thesis. I'll be patient! :smiley:
I had a read through the link you sent me, and I, not being a coder, don't quite understand what it all means.

been a couple weeks... just a bump :slight_smile:

another bump...

Hey,
sorry for letting you wait this long.... the final steps of the thesis are quite horrible thanks to my great time management haha. The next Tuesday is the due-date an the journey finally will have an end after something around 8 month. What ever, I just want you to know that I didn't want to disrespect you :slight_smile:
So in the next week I am complete available and I think we will solve all the problem!

For now I think you can try to get some experience with the terminal just for practice propose since we are facing some "basic" problems (like: create a python script, working path in terminal, system permissions and program dependencies...)

You can try to make your account admin as well and re-run all the commands with sudo in front of each command. Let me know how it is going.

So where we are standing actually. is anything "new" working?

Hi
I haven't done anything since we last chatted.
I understand, and look forward to getting this to work!

Okay here we go again! Thesis is done :slight_smile:

AWESOME!!! hope it went well :smiley:

I think it depends... we will see in 8 days, after my defense :grin: but I'm very happy with the result.

Okay were are we standing and how could we get back on track?

nows probably not a good time.... its late and ima go to bed soon. also, do we wanna take this to messenger or something?