错误我得到了 pip youtube-dl

错误我得到了 pip youtube-dl

这是我遇到的错误。我该怎么办?

The directory '/home/wanderer/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

wanderer@wanderer-HP-Pavilion-15-Notebook-PC:~$ ls -l ~/.cache
total 10896
drwx------ 2 wanderer wanderer     4096 Jan 31 18:27 compizconfig-1
-rw-r--r-- 1 wanderer wanderer    20480 Dec 21 17:08 event-sound-cache.tdb.32d9967adb37400189d126e0f5a3027d.x86_64-pc-linux-gnu
drwx------ 8 wanderer wanderer     4096 Nov 13 06:34 evolution
drwxr-xr-x 2 wanderer wanderer     4096 Nov 17 07:52 fontconfig
drwxr-xr-x 2 wanderer wanderer     4096 Jan 26 09:08 gnome-calculator
drwxrwxr-x 3 wanderer wanderer     4096 Nov 13 06:35 gnome-software
drwx------ 3 wanderer wanderer     4096 Nov 13 20:11 google-chrome
drwxrwxr-x 2 wanderer wanderer     4096 Jan 31 18:27 gstreamer-1.0
drwxrwxr-x 3 wanderer wanderer     4096 Nov 13 06:34 ibus
-rw-rw-r-- 1 wanderer wanderer 10547304 Jan 31 09:56 icon-cache.kcache
drwxrwxr-x 2 wanderer wanderer     4096 Nov 20 15:55 indicator-appmenu
-rw-rw-r-- 1 wanderer wanderer   474971 Jan 31 09:56 ksycoca5_en-IN_heSnpj7ybDg_HlxVjeY2lnFbClw=
drwxrwxr-x 2 wanderer wanderer     4096 Jan 31 18:28 logrotate
drwx------ 3 wanderer wanderer     4096 Nov 13 18:38 mozilla
drwxrwxr-x 2 wanderer wanderer     4096 Dec 19 07:06 pdfmod
drwxrwxr-x 3 wanderer wanderer     4096 Dec 16 20:53 shotwell
drwx------ 3 wanderer wanderer     4096 Dec 26 08:09 simple-scan
drwx------ 5 wanderer wanderer     4096 Nov 13 07:05 thumbnails
drwx------ 3 wanderer wanderer     4096 Dec 19 20:29 thunderbird
drwxr-xr-x 3 wanderer wanderer     4096 Nov 13 19:47 totem
drwx------ 3 wanderer wanderer     4096 Nov 14 08:16 unity-control-center
drwxrwxr-x 2 wanderer wanderer     4096 Jan 15 04:59 update-manager-core
drwx------ 2 wanderer wanderer    16384 Jan 31 20:42 upstart
drwx------ 3 wanderer wanderer     4096 Dec 10 20:22 vlc
drwx------ 2 wanderer wanderer     4096 Nov 19 08:17 wallpaper
drwxrwxr-x 3 wanderer wanderer     4096 Nov 28 08:05 youtube-dl
-rw-rw-r-- 1 wanderer wanderer       11 Jan 25 07:09 zeitgeist-vacuum.stamp
wanderer@wanderer-HP-Pavilion-15-Notebook-PC:~$ 

sudo pip 安装--升级 youtube-dl

好的!!我该怎么办?

答案1

不要使用 sudo,如果您使用pip然后安装到您的主目录,如下所示:

pip install --user youtube-dl

卸载您现在拥有的任何版本并以普通用户身份运行上述命令,您将不再遇到权限问题。要更新,请使用:

pip install --upgrade --user youtube-dl

相关内容