“ pip install –editable ./” vs“ python setup.py开发”

问题:“ pip install –editable ./” vs“ python setup.py开发”

两者之间有什么明显区别

pip install -e /path/to/mypackage

和setuptools的变体?

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

Is there any significant difference between

pip install -e /path/to/mypackage

and the setuptools variant?

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

回答 0

尝试避免setup.py直接调用,它不会正确告诉pip您已安装软件包。

pip install -e

对于本地项目,相对于项目路径创建“ SomeProject.egg-info”目录。与仅使用相比setup.py develop,这是一个优势 ,它可以直接相对于当前工作目录创建“ egg-info”。

更多:文档

另请阅读setuptools的文档

Try to avoid calling setup.py directly, it will not properly tell pip that you’ve installed your package.

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.