0

When performing

sudo pip3 install --user -U youtube-dl

I get 2 warnings:

1. WARNING: The directory '/home/mue/.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.

2. WARNING: The script youtube-dl is installed in '/home/mue/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Questions:

Concering 1. How can I resolve this?

Concering 2. Do you recommend ideed adding this to path. If yes: What is the command?

  • 1
    Please run the following command and then copy and paste the result in your question: echo $PATH Thanks! – mchid Jul 29 at 23:30
2

When you run pip3 using the sudo command, the file that is installed is owned by root instead of your current user mue. The purpose of running pip or pip3 with --user is so that you don't have to use sudo when you install stuff.

First, you can run the following command to restore ownership to your current user:

sudo chown $USER:$USER $HOME/.local/bin/youtube-dl

Next, you can run the following command to properly update youtube-dl

pip3 install --user -U youtube-dl

Finally, if you do not get a warning about your path, you are done.

However, if you still get a warning that youtube-dl is not in your path, you can run the following commands to add the directory to your path:

cp ~/.profile ~/.profilebackup
echo 'export PATH=$HOME/.local/bin:$PATH' | tee -a ~/.profile
source ~/.profile
  • If you run the echo command, make sure you use tee -a so that it will "append" to the file. If you mess up, you can always restore the original file using: cp ~/.profilebackup ~/.profile. – mchid Jul 29 at 23:16

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.