1

I recently installed spotdl (Spotify Downloader) by following the instructions given at GitHub's Installation page. However, when I try to run the tool and execute the commands provided at the project page, Terminal results with the following message: spotdl: command not found.

I am rather an inexperienced user with Linux, but I think I might have made an error in the installation process. See, the command that I ran to install the tool was pip install -U spotdl (according to the source number one). However, the source number two — that is the project page — tells to run a different command, pip3 install spotdl, emphasizing that the tool only works with Python 3. Well, before noticing the latter, I already had followed the steps provided by the former.

And that's not all. While running pip install -U spotdl, I received the following message:

XXXXs@pop-os:~$ pip install -U spotdl

Command 'pip' not found, but can be installed with:

sudo apt install python-pip

Well, I decided to follow the advice and run the command above, resulting:

XXXXs@pop-os:~$ sudo apt install python-pip
[sudo] password for XXXXs: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libllvm7 libllvm7:i386 libvala-0.40-0 valac-0.40-vapi
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpython-all-dev libpython-dev libpython2.7-dev python-all python-all-dev
  python-dev python-pip-whl python-setuptools python-wheel python-xdg
  python2.7-dev
Suggested packages:
  python-setuptools-doc
The following NEW packages will be installed:
  libpython-all-dev libpython-dev libpython2.7-dev python-all python-all-dev
  python-dev python-pip python-pip-whl python-setuptools python-wheel
  python-xdg python2.7-dev
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.8 MB of archives.
After this operation, 46.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7-dev amd64 2.7.15-4ubuntu4~18.04 [28.3 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpython-dev amd64 2.7.15~rc1-1 [7,684 B]
Get:3 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libpython-all-dev amd64 2.7.15~rc1-1 [1,092 B]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-all amd64 2.7.15~rc1-1 [1,076 B]
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 python2.7-dev amd64 2.7.15-4ubuntu4~18.04 [278 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-dev amd64 2.7.15~rc1-1 [1,256 B]
Get:7 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-all-dev amd64 2.7.15~rc1-1 [1,100 B]
Get:8 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python-pip-whl all 9.0.1-2.3~ubuntu1.18.04.1 [1,653 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 python-pip all 9.0.1-2.3~ubuntu1.18.04.1 [151 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 python-setuptools all 39.0.1-2 [329 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python-wheel all 0.30.0-0.2 [36.4 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 python-xdg all 0.25-4ubuntu1 [31.3 kB]
Fetched 30.8 MB in 50s (614 kB/s)                                              
Selecting previously unselected package libpython2.7-dev:amd64.
(Reading database ... 257811 files and directories currently installed.)
Preparing to unpack .../00-libpython2.7-dev_2.7.15-4ubuntu4~18.04_amd64.deb ...
Unpacking libpython2.7-dev:amd64 (2.7.15-4ubuntu4~18.04) ...
Selecting previously unselected package libpython-dev:amd64.
Preparing to unpack .../01-libpython-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking libpython-dev:amd64 (2.7.15~rc1-1) ...
Selecting previously unselected package libpython-all-dev:amd64.
Preparing to unpack .../02-libpython-all-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking libpython-all-dev:amd64 (2.7.15~rc1-1) ...
Selecting previously unselected package python-all.
Preparing to unpack .../03-python-all_2.7.15~rc1-1_amd64.deb ...
Unpacking python-all (2.7.15~rc1-1) ...
Selecting previously unselected package python2.7-dev.
Preparing to unpack .../04-python2.7-dev_2.7.15-4ubuntu4~18.04_amd64.deb ...
Unpacking python2.7-dev (2.7.15-4ubuntu4~18.04) ...
Selecting previously unselected package python-dev.
Preparing to unpack .../05-python-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking python-dev (2.7.15~rc1-1) ...
Selecting previously unselected package python-all-dev.
Preparing to unpack .../06-python-all-dev_2.7.15~rc1-1_amd64.deb ...
Unpacking python-all-dev (2.7.15~rc1-1) ...
Selecting previously unselected package python-pip-whl.
Preparing to unpack .../07-python-pip-whl_9.0.1-2.3~ubuntu1.18.04.1_all.deb ...
Unpacking python-pip-whl (9.0.1-2.3~ubuntu1.18.04.1) ...
Selecting previously unselected package python-pip.
Preparing to unpack .../08-python-pip_9.0.1-2.3~ubuntu1.18.04.1_all.deb ...
Unpacking python-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Selecting previously unselected package python-setuptools.
Preparing to unpack .../09-python-setuptools_39.0.1-2_all.deb ...
Unpacking python-setuptools (39.0.1-2) ...
Selecting previously unselected package python-wheel.
Preparing to unpack .../10-python-wheel_0.30.0-0.2_all.deb ...
Unpacking python-wheel (0.30.0-0.2) ...
Selecting previously unselected package python-xdg.
Preparing to unpack .../11-python-xdg_0.25-4ubuntu1_all.deb ...
Unpacking python-xdg (0.25-4ubuntu1) ...
Setting up python-pip-whl (9.0.1-2.3~ubuntu1.18.04.1) ...
Setting up python-setuptools (39.0.1-2) ...
Setting up python-wheel (0.30.0-0.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up libpython2.7-dev:amd64 (2.7.15-4ubuntu4~18.04) ...
Setting up python-pip (9.0.1-2.3~ubuntu1.18.04.1) ...
Setting up python2.7-dev (2.7.15-4ubuntu4~18.04) ...
Setting up python-all (2.7.15~rc1-1) ...
Setting up python-xdg (0.25-4ubuntu1) ...
Setting up libpython-dev:amd64 (2.7.15~rc1-1) ...
Setting up python-dev (2.7.15~rc1-1) ...
Setting up libpython-all-dev:amd64 (2.7.15~rc1-1) ...
Setting up python-all-dev (2.7.15~rc1-1) ...
XXXXs@pop-os:~$ pip install -U spotdl

Now, when I run pip -V in Terminal, I'll get the following:

XXXXs@pop-os:~$ pip -V
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
XXXXs@pop-os:~$

So this means I have indeed Python 2 installed on my system, doesn't it? What should I do in this case? Remove Python 2 from the system — to avoid bloating the system, if for nothing else — and install Python 3? But I don't know how to :-( Your kind help would be deeply appreciated!

Otherwise, I already have the newest version of ffmpeg:

@pop-os:~$ sudo apt-get install ffmpeg
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ffmpeg is already the newest version (7:3.4.6-0ubuntu0.18.04.1).
The following packages were automatically installed and are no longer required:
  libllvm7 libllvm7:i386 libvala-0.40-0 valac-0.40-vapi
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
XXXXs@pop-os:~$

Oh, and this is the installation log of spotdl, just in case:

XXXXs@pop-os:~$ pip install -U spotdl
Collecting spotdl
  Downloading https://files.pythonhosted.org/packages/9a/6d/    b66a58f08890965f4afb94bc3738624407328fc12c081697ac18537d0446/spotdl-0.9.3.tar.gz
Collecting PyYAML    =3.12 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/    a3/65/837fefac7475963d1eccf4aa684c23b95aa6c1d033a2c5965ccb11e22623/PyYAML-5.1.1.tar.gz (274kB)
    100% |████████████████████████████████| 276kB 944kB/s 
Collecting beautifulsoup4    =4.6.0 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/8b/0e/    048a2f88bc4be5e3697df9dc1f7b9d5c9c75be62676feeeb91d2e896c5ea/beautifulsoup4-4.7.1-py2-none-any.whl (94kB)
    100% |████████████████████████████████| 102kB 507kB/s 
Collecting logzero    =1.3.1 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/    97/24/27295d318ea8976b12cf9cc51d82e7c7129220f6a3cc9e3443df3be8afdb/logzero-1.5.0-py2.py3-none-any.whl
Collecting lyricwikia    =0.1.8 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/36/82/dfce4509b6097cdacfab4510a401ef007e8314a2d1d179267efd873d1a55/lyricwikia-0.1.9.tar.gz
Collecting mutagen    =1.37 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/30/4c/    5ad1a6e1ccbcfaf6462db727989c302d9d721beedd9b09c11e6f0c7065b0/mutagen-1.42.0.tar.gz (925kB)
    100% |████████████████████████████████| 931kB 717kB/s 
Collecting pafy    =0.5.3.1 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/b0/e8/3516f761558525b00d3eaf73744eed5c267db20650b7b660674547e3e506/pafy-0.5.4-py2.py3-none-any.whl
Collecting pathlib    =1.0.1 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/ac/aa/9b065a76b9af472437a0059f77e8f962fe350438b927cb80184c32f075eb/pathlib-1.0.1.tar.gz (49kB)
    100% |████████████████████████████████| 51kB 948kB/s 
Collecting spotipy    =2.4.4 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/59/46/3c957255c96910a8a0e2d9c25db1de51a8676ebba01d7966bedc6e748822/spotipy-2.4.4.tar.gz
Collecting titlecase    =0.10.0 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/3b/78/5b9faa7b9288c9fa5a4fdb6989f5e675744511ab6cff0489a0c7744a4f6b/titlecase-0.12.0.tar.gz
Collecting unicode-slugify    =0.1.3 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/8c/ba/1a05f61c7fd72df85ae4dc1c7967a3e5a4b6c61f016e794bc7f09b2597c0/unicode-slugify-0.1.3.tar.gz
Collecting youtube_dl    =2017.5.1 (from spotdl)
  Downloading https://files.pythonhosted.org/packages/f6/05/908331f41e7ed52a3510c8927177056ffc7d26c3692ab87e3fad78081a05/youtube_dl-2019.6.21-py2.py3-none-any.whl (1.8MB)
    100% |████████████████████████████████| 1.8MB 613kB/s 
Collecting soupsieve    =1.2 (from beautifulsoup4    =4.6.0-    spotdl)
  Downloading https://files.pythonhosted.org/packages/b9/a5/7ea40d0f8676bde6e464a6435a48bc5db09b1a8f4f06d41dd997b8f3c616/soupsieve-1.9.1-py2.py3-none-any.whl
Collecting requests (from lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 1.8MB/s 
Collecting six (from lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting unidecode (from unicode-slugify    =0.1.3-    spotdl)
  Downloading https://files.pythonhosted.org/packages/d0/42/d9edfed04228bacea2d824904cae367ee9efd05e6cce7ceaaedd0b0ad964/Unidecode-1.1.1-py2.py3-none-any.whl (238kB)
    100% |████████████████████████████████| 245kB 1.2MB/s 
Collecting backports.functools-lru-cache; python_version < "3" (from soupsieve    =1.2-    beautifulsoup4    =4.6.0-    spotdl)
  Downloading https://files.pythonhosted.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,    =1.21.1 (from requests-    lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl (150kB)
    100% |████████████████████████████████| 153kB 1.4MB/s 
Collecting certifi    =2017.4.17 (from requests-    lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/69/1b/b853c7a9d4f6a6d00749e94eb6f3a041e342a885b87340b79c1ef73e3a78/certifi-2019.6.16-py2.py3-none-any.whl (157kB)
    100% |████████████████████████████████| 163kB 771kB/s 
Collecting chardet<3.1.0,    =3.0.2 (from requests-    lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 1.0MB/s 
Collecting idna<2.9,    =2.5 (from requests-    lyricwikia    =0.1.8-    spotdl)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 2.1MB/s 
Building wheels for collected packages: spotdl, PyYAML, lyricwikia, mutagen, pathlib, spotipy, titlecase, unicode-slugify
  Running setup.py bdist_wheel for spotdl ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/27/9b/65/5cd2c56c23f5566ace8fc31393943251124de819bd069f2d2c
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/16/27/a1/775c62ddea7bfa62324fd1f65847ed31c55dadb6051481ba3f
  Running setup.py bdist_wheel for lyricwikia ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/5e/7d/5d/b77975b5cabfc8848a795a851b07b3fde7fd685b27e501d055
  Running setup.py bdist_wheel for mutagen ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/33/4c/c3/6189a75038a7b00a8bc77fcb4dbdc38de335c55443f6680b13
  Running setup.py bdist_wheel for pathlib ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/f9/b2/4a/68efdfe5093638a9918bd1bb734af625526e849487200aa171
  Running setup.py bdist_wheel for spotipy ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/76/28/19/a86ca9bb0e32dbd4a4f580870250f5aeef852870578e0427e6
  Running setup.py bdist_wheel for titlecase ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/9f/fb/8f/4d61939e2447b1b8c13f6ceeca035383c14d4228e88b174402
  Running setup.py bdist_wheel for unicode-slugify ... done
  Stored in directory: /home/XXXXs/.cache/pip/wheels/00/86/80/77ea75d401d5d6550a79179f76c6b26fe1280d40fb447ea4f3
Successfully built spotdl PyYAML lyricwikia mutagen pathlib spotipy titlecase unicode-slugify
Installing collected packages: PyYAML, backports.functools-lru-cache, soupsieve, beautifulsoup4, logzero, urllib3, certifi, chardet, idna, requests, six, lyricwikia, mutagen, pafy, pathlib, spotipy, titlecase, unidecode, unicode-slugify, youtube-dl, spotdl
Successfully installed PyYAML-5.1.1 backports.functools-lru-cache-1.5 beautifulsoup4-4.7.1 certifi-2019.6.16 chardet-3.0.4 idna-2.8 logzero-1.5.0 lyricwikia-0.1.9 mutagen-1.42.0 pafy-0.5.4 pathlib-1.0.1 requests-2.22.0 six-1.12.0 soupsieve-1.9.1 spotdl-0.9.3 spotipy-2.4.4 titlecase-0.12.0 unicode-slugify-0.1.3 unidecode-1.1.1 urllib3-1.25.3 youtube-dl-2019.6.21
XXXXs@pop-os:~$ 

I hope I haven't messed up anything entirely. Thanks a lot for your help in advance, and happy Midsummer's Day!

1

Python 2 and Python 3 can be installed on the same system without conflict. You can install the Python 3 version of pip similar to how you installed the Python 2 version:

sudo apt install python3-pip

Now, you you should be able to use pip3 to install spotdl:

pip3 install spotdl

I just tried this on my own system and the installation failed when running the command as a regular user*; I had to install it as a superuser (using sudo) which successfully installed the program to /usr/local/bin/spotdl.


Removing Python 2 pip and packages installed by it

If you’re really constrained by resources, What is the easiest way to remove all packages installed by pip? shows how to remove the packages installed by pip2.

pip2 freeze | xargs pip2 uninstall -y

To remove the pip2 Debian package, run sudo apt-get remove --purge python-pip followed by sudo apt-get autoremove to remove dependencies that are no longer required.


* This could be due to too much messing around with installing pip and pip3 from different sources years ago when I first installed my current system (Ubuntu 16.04).

  • Thanks! How about the pip install -U spotdl? Is it now a separate installation of the spotdl tool for Python 2? It's just that I am a little bit minimalistic, and I'd rather remove all the unnecessary installations from my systems if I don't need them :-) So if it isn't too much trouble, could you please help me to uninstall Python 2 and the related tool installation, pip install -U spotdl as well? It's the Midsummer's night here right now, and the clock is nearly 1 am, so I'll be back tomorrow. Anyway, thousand thanks for your kind help, Anthony Geoghegan! :-) – Jayaguru-Shishya Jun 22 at 21:48
  • I've updated my answer to show how to remove the Python 2 packages installed by Python 2 pip and to then remove the package itself. – Anthony Geoghegan Jun 22 at 23:17
  • Thank you very much! Sorry for my late reply, I really got knee deep in the hoopla while trying to solve other issues, which finally lead to a fresh install of Pop!_OS 19.04 on my system :-D I'll soon install pip3 on my system (no need to remove pip2, thank God), and then try to run pip3 install spotdl to see if it works. But I'll let you know and answer more precisely soon! Thanks still for your help kind and insightful. – Jayaguru-Shishya Aug 4 at 15:07
  • Yepp! Worked great! Thanks for your kind help @AnthonyGeoghegan ! – Jayaguru-Shishya Aug 6 at 14:59
  • @Jayaguru-Shishya Glad to hear it helped. I don’t have too much time these days to answer questions but yours was well written with a good description of the problem – which is always good to see for someone’s first question (hence the upvote). – Anthony Geoghegan Aug 12 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.