Setup in virtualenv: `pip install -e .` vs `python setup.py install`

前端 未结 1 434
庸人自扰
庸人自扰 2021-02-05 17:42

I\'m following a Flask tutorial that has me using virtualenv, and with it I built an app directory tree that looks like this:

app/
|__app/
|__app.eg         


        
1条回答
  •  天涯浪人
    2021-02-05 18:13

    First, the commands you mention are not equivalent, specifically python setup.py install does not give you an editable installation. The pip <-> python setup.py equivalents are:

    Editable   pip                    setup.py
    yes        pip install -e .       python setup.py develop    
    no         pip install .          python setup.py install    
    

    With that said, using pip is in general recommended for a range of reasons:

    • Dependencies are automatically installed
    • There is an easy way to uninstall

    In your case, I highly suspect that your package has a dependency which is automatically installed if you use pip, but not if you use python setup.py install.

    0 讨论(0)
提交回复
热议问题