Pop!_OS:Spotify 下载器(spotdl:未找到命令)

Pop!_OS:Spotify 下载器(spotdl:未找到命令)

我最近spotdl按照以下网址的说明安装了(Spotify Downloader)GitHub 的安装页面。但是,当我尝试运行该工具并执行提供的命令时项目页面Terminal结果显示以下消息:spotdl: command not found

我是一个对 Linux 相当缺乏经验的用户,但我想我可能在安装过​​程中犯了一个错误。看,我运行来安装该工具的命令是pip install -U spotdl(根据第一个源)。然而,第二个源代码(即项目页面)告诉我们运行不同的命令 ,pip3 install spotdl强调该工具仅适用于Python 3.好吧,在注意到后者之前,我已经按照前者提供的步骤进行了操作。

这还不是全部。运行时pip install -U spotdl,我收到以下消息:

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

未找到命令“pip”,但可以使用以下命令安装:

sudo apt 安装 python-pip

好吧,我决定遵循建议并运行上面的命令,结果是:

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

现在,当我运行时pip -VTerminal我会得到以下信息:

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

那么这意味着我确实已经Python 2安装在我的系统上,不是吗?这种情况我该怎么办?Python 2从系统中删除- 以避免系统膨胀,如果没有其他目的 - 并安装Python 3?但我不知道如何:-( 非常感谢您的帮助!

否则,我已经拥有最新版本的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:~$

哦,这是安装日志spotdl,以防万一:

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:~$ 

我希望我没有完全搞砸任何事情。非常感谢您提前提供的帮助,祝仲夏节快乐!

答案1

Python 2 和 Python 3 可以安装在同一系统上,不会发生冲突。您可以pip像安装 Python 2 版本一样安装 Python 3 版本:

sudo apt install python3-pip

现在,您应该能够使用以下命令pip3来安装spotdl

pip3 install spotdl

我刚刚在自己的系统上尝试过此操作,但以普通用户身份运行命令时安装失败* ;我必须以超级用户身份安装它(使用sudo),成功地将程序安装到/usr/local/bin/spotdl.


删除 Python 2 pip 及​​其安装的软件包

如果你确实受到资源的限制,删除 pip 安装的所有软件包的最简单方法是什么?显示如何删除由pip2.

pip2 freeze | xargs pip2 uninstall -y

要删除pip2Debian 软件包,请sudo apt-get remove --purge python-pip依次运行sudo apt-get autoremove以删除不再需要的依赖项。


*这可能是由于几年前我第一次安装当前系统(Ubuntu 16.04)时,安装pip和来自不同来源的麻烦太多。pip3

相关内容