Is there a way to install all python modules at once using pip?

前端 未结 3 587
[愿得一人]
[愿得一人] 2021-01-02 23:16

I would like to install all available modules for Python 2.7.12 using a single pip command. Is there a way to do this without having to specify every single package name?

3条回答
  •  青春惊慌失措
    2021-01-02 23:38

    I highly recommend against doing this - the overwhelmingly supported best practice is to use a requirements.txt file, listing the packages you want to install specifically.

    You then install it with pip install -r requirements.txt and it installs all the packages for your project.

    This has several benefits:

    • Repeatability by installing only the required packages
    • Conciseness

    However, if you really do want to install ALL python packages (note that there are thousands), you can do so via the following:

    pip search * | grep ")[[:space:]]" | cut -f1 -d" "

    I strongly recommend against this as it's likely to do horrible things to your system, as it will attempt to install every python package (and why it's in spoiler tags).

提交回复
热议问题