Я пытаюсь обновить pip
с sudo
следующим образом:
kurt@kurt-ThinkPad:~$ sudo pip install --upgrade pip
[sudo] password for kurt:
The directory '/home/kurt/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/kurt/.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.
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
Хотя сообщение заканчивается "Требованием, уже актуальным", если я делаю a pip
команда я получаю предупреждение, что я не использую новую версию:
kurt@kurt-ThinkPad:~$ pip show dateutil
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Как я могу обновить pip
правильно?
Можно использовать sudo
-H
флаг. Это говорит там в сообщении об ошибке:
При выполнении зернышка с sudo, можно хотеть флаг-H sudo.
Так, корректный путь был бы:
sudo -H pip install --upgrade pip
-H
наборы флага $HOME
переменная пользователям домой между прочим.