“pip install --editable ./” vs “python setup.py de

2019-01-12 20:05发布

Is there any significant difference between

pip install -e /path/to/mypackage

and the setuptools variant?

python /path/to/mypackage/setup.py develop

3条回答
爷、活的狠高调
2楼-- · 2019-01-12 20:11

There is no big difference.

With pip install -e:

For local projects, the “SomeProject.egg-info” directory is created relative to the project path. This is one advantage over just using setup.py develop, which creates the “egg-info” directly relative the current working directory.

More: docs

Also read the setuptools' docs.

查看更多
贼婆χ
3楼-- · 2019-01-12 20:24

Another difference that may favor pip install -e is that if your project has dependencies in install_requires in setup.py, then pip install -e . installs dependencies with pip, while python setup.py develop can installs with easy_install, and may cause problems re: 'egg-info' as mentioned above. When install-requires uses dependency_links with custom git URLs, with attached egg identifiers, this can be especially annoying.

查看更多
走好不送
4楼-- · 2019-01-12 20:27

One more difference: pip install -e uses wheel while python setup.py develop
doesn't use it.

With install, you could achieve the same behavior by using
pip install -e /path/to/package --no-use-wheel

More info on wheels : python wheels

查看更多
登录 后发表回答