Search code examples
pythonubuntusudo

Give sudo permission to all simple pip installed packages


On my ubuntu server, some of the installed python packages are simple pip install some are sudo pip install. Is there any way I can give sudo permission to simple pip install?

Note: There is around 250+ package. Installing one by one is quite hectic. Please help.


Solution

  • Create requirements.txt file through cmd: pip freeze > requirements.txt it'll list all the python installed packages in you're system to that file. once you got the all packages install using either sudo or normal pip.

    • with sudo: sudo pip install -r requirements.txt
    • with out sudo : pip install -r requirements.txt

    i hope this will help you.