“pip install --editable ./"vs “python setup.py 开发" [英] "pip install --editable ./" vs "python setup.py develop"

查看:37
本文介绍了“pip install --editable ./"vs “python setup.py 开发"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有显着差异

pip install -e /path/to/mypackage

和 setuptools 变体?

and the setuptools variant?

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

推荐答案

尽量避免直接调用 setup.py,它不会正确地告诉 pip 你已经安装了你的包.

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

使用pip install -e:

对于本地项目,创建SomeProject.egg-info"目录相对于项目路径.这是比仅使用的优势之一setup.py develop,它直接相对于当前工作目录.

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.

更多:文档

另请阅读 setuptools 的文档.

Also read the setuptools' docs.

这篇关于“pip install --editable ./"vs “python setup.py 开发"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆