pip install failing with: OSError: [Errno 13] Permission denied on directory

前端 未结 8 1524
独厮守ぢ
独厮守ぢ 2020-11-21 22:43

pip install -r requirements.txt fails with the exception below OSError: [Errno 13] Permission denied: \'/usr/local/lib/.... What\'s wrong and how d

8条回答
  •  闹比i
    闹比i (楼主)
    2020-11-21 22:50

    We should really stop advising the use of sudo with pip install. It's better to first try pip install --user. If this fails then take a look at the top post here.

    The reason you shouldn't use sudo is as follows:

    When you run pip with sudo, you are running arbitrary Python code from the Internet as a root user, which is quite a big security risk. If someone puts up a malicious project on PyPI and you install it, you give an attacker root access to your machine.

提交回复
热议问题