setup.py install 和 setup.py develop 的区别 [英] Difference between setup.py install and setup.py develop

查看:90
本文介绍了setup.py install 和 setup.py develop 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发 python 模块时试图改进我的工作流程,但有一个相当基本的问题.

I am trying to improve my workflow when developing python modules and have a rather basic question.

选择任一选项时究竟会发生什么.据我所知,develop 会将文件留在原处,以便我可以修改它们并使用该包,而 install 会将它们复制到 site-packages我的python安装文件夹.使用 develop 选项时,包如何链接到我的 python 安装.

What exactly happens when choosing either option. To my knowledge develop leaves the files in place so I can modify them and play around with the package whereas install copies them in the site-packages folder of my python installation. How is the package linked to my python installation when using the develop option.

推荐答案

developsite-packages 中创建一个 .egg-link 文件> 目录,它指向项目文件的位置.相同的路径也被添加到 easy-install.pth 文件的相同位置.使用 setup.py develop -u 卸载会再次删除该链接文件.

develop creates an .egg-link file in the site-packages directory, which points back to the location of the project files. The same path is also added to the easy-install.pth file in the same location. Uninstalling with setup.py develop -u removes that link file again.

请注意,任何尚未出现的 install_requires 依赖项也已安装,就像普通的鸡蛋一样(它们是 easy_install-ed).卸载开发蛋时不会卸载这些依赖项.

Do note that any install_requires dependencies not yet present are also installed, as regular eggs (they are easy_install-ed). Those dependencies are not uninstalled when uninstalling the development egg.

这篇关于setup.py install 和 setup.py develop 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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