What is pip's equivalent of `npm install package --save-dev`?

前端 未结 8 1982
生来不讨喜
生来不讨喜 2021-01-29 20:07

In nodejs, I can do npm install package --save-dev to save the installed package into the package.

How do I achieve the same thing in Python package manager

8条回答
  •  旧时难觅i
    2021-01-29 20:53

    you can manually save it in a Makefile (or a text file and then imported in your Makefile):


    PYTHON=.venv/bin/python # path to pyphon
    PIP=.venv/bin/pip # path to pip
    SOURCE_VENV=. .venv/bin/activate
    
    
    install:
        virtualenv .venv
        $(SOURCE_VENV) && $(PIP) install -e PACKAGE
        $(SOURCE_VENV) && $(PIP) install -r requirements.txt # other required packages
    

    and then just run make install

提交回复
热议问题