pip: Why sometimes installed as egg, sometimes installed as files

前端 未结 3 783
旧时难觅i
旧时难觅i 2021-02-14 08:56

Where can you force pip to install as \"flat\" and not as \"egg\".

For me it seems random. Sometimes it gets installed as egg, sometime as flat.

pip help i

3条回答
  •  庸人自扰
    2021-02-14 09:22

    I was having this egg-only install problem, and it turned out I had failed to git add the __init__.py in the root of my package. It was driving me crazy that this would work:

    pip install .
    

    ...but this would fail:

    mkdir /tmp/piptest
    cd /tmp/piptest
    git clone $OLDPWD .
    pip install .
    

    It was hard to notice the difference using diff -r . $OLDPWD because there are so many non-committed pyc files and development tool scripts.

    This is probably not the answer for this OP, but I hope it helps someone who Googles "pip only installing the egg" as I did.

提交回复
热议问题