Do I need to sudo when running pip/easy_install?

stephenmurdoch

All of the python tuts I've been reading lately tell me to do things like this:

pip install tornado
pip install requests

And every time I do this I get hit with a permission denied warning. But everything usually works when I sudo.

Is sudo required? And if so, why do so many tutorial instructions fail to mention that?

In ruby we can install using Rbenv or RVM, both of which remove the need to use sudo. Is there any equivalent in python? Or is it implied that you should always sudo?

Ffisegydd

pip requires permission to write the libraries to whichever directory it is using. This problem occurs when you do not have permission as a user and so pip fails. Using sudo gets around this problem but is not ideal.

You should not ever run code using sudo as you don't know what is inside the library, if it contains malicious code you could cause serious damage to your computer.

You can fix this problem by ensuring that you have permissions to write to the directory that pip is set up to use.

A better alternative (as you've suggested in your comment) is to use a virtualenv, this will allow you to use pip without the need of sudo. Make sure you do not create this virtualenv using sudo though as then you won't have permissions to write to it as a normal user.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Do I need to tune sysctl.conf under linux when running MongoDB?

来自分类Dev

Do I need to cleanup my event handlers when DOM changes?

来自分类Dev

Do I need STUN?

来自分类Dev

How do I patch or modify a list inside of a function when running a unit test?

来自分类Dev

How do I force SSL when running an express app behind Apache?

来自分类Dev

When do we need deep copy in c

来自分类Dev

Why do I need to update uvs?

来自分类Dev

Why do I need depthBuffer to use RenderTexture?

来自分类Dev

Do I need to free popup menus in GTK?

来自分类Dev

Which keys do I need for CNContactFormatter?

来自分类Dev

When do we need to manually watch scope variable and when not in AngularJS

来自分类Dev

What do I need to do to use tgmath on iOS?

来自分类Dev

When do we need to use verify method of Mockito?

来自分类Dev

What regex do I need for Java String.split for this case

来自分类Dev

Do I need to commit a code if doing an insert before an update?

来自分类Dev

Why do i need the gil for PyMem_Malloc()?

来自分类Dev

Do I need rel="nofollow" in external scripts and stylesheets?

来自分类Dev

Atomic Operation Thread Safety - Do I Need a "Mirror" Atomic Read?

来自分类Dev

Do I need to call delete before reassigning a pointer?

来自分类Dev

Why do I need another constructor in an extended abstract class?

来自分类Dev

OpenSSL for making iOS certs on a windows machine - do I need a server?

来自分类Dev

Do I need a keyring password on a luks encrypted single user machine?

来自分类Dev

Safely storing credentials when I need to retrieve the password for use

来自分类Dev

sudo -i返回错误

来自分类Dev

sudo -i返回错误

来自分类Dev

How do I detect running processes using a library package?

来自分类Dev

sudo -i和sudo su之间的区别

来自分类Dev

禁用sudo -s和sudo -i

来自分类Dev

su vs sudo -s vs sudo -i vs sudo bash

Related 相关文章

  1. 1

    Do I need to tune sysctl.conf under linux when running MongoDB?

  2. 2

    Do I need to cleanup my event handlers when DOM changes?

  3. 3

    Do I need STUN?

  4. 4

    How do I patch or modify a list inside of a function when running a unit test?

  5. 5

    How do I force SSL when running an express app behind Apache?

  6. 6

    When do we need deep copy in c

  7. 7

    Why do I need to update uvs?

  8. 8

    Why do I need depthBuffer to use RenderTexture?

  9. 9

    Do I need to free popup menus in GTK?

  10. 10

    Which keys do I need for CNContactFormatter?

  11. 11

    When do we need to manually watch scope variable and when not in AngularJS

  12. 12

    What do I need to do to use tgmath on iOS?

  13. 13

    When do we need to use verify method of Mockito?

  14. 14

    What regex do I need for Java String.split for this case

  15. 15

    Do I need to commit a code if doing an insert before an update?

  16. 16

    Why do i need the gil for PyMem_Malloc()?

  17. 17

    Do I need rel="nofollow" in external scripts and stylesheets?

  18. 18

    Atomic Operation Thread Safety - Do I Need a "Mirror" Atomic Read?

  19. 19

    Do I need to call delete before reassigning a pointer?

  20. 20

    Why do I need another constructor in an extended abstract class?

  21. 21

    OpenSSL for making iOS certs on a windows machine - do I need a server?

  22. 22

    Do I need a keyring password on a luks encrypted single user machine?

  23. 23

    Safely storing credentials when I need to retrieve the password for use

  24. 24

    sudo -i返回错误

  25. 25

    sudo -i返回错误

  26. 26

    How do I detect running processes using a library package?

  27. 27

    sudo -i和sudo su之间的区别

  28. 28

    禁用sudo -s和sudo -i

  29. 29

    su vs sudo -s vs sudo -i vs sudo bash

热门标签

归档