本文翻译自:Python setup.py develop vs install

Two options in setup.py develop and install are confusing me. setup.py developinstall中的两个选项使我感到困惑。 According to this site , using develop creates a special link to site-packages directory. 根据此站点 ,使用develop创建到site-packages目录的特殊链接。

People have suggested that I use python setup.py install for a fresh installation and python setup.py develop after any changes have been made to the setup file. 人们建议我将python setup.py install用于全新安装,并对设置文件进行任何更改后再使用python setup.py develop

Can anyone shed some light on the usage of these commands? 任何人都可以阐明这些命令的用法吗?


#1楼

参考:https://stackoom.com/question/1HvRc/Python-setup-py开发与安装


#2楼

python setup.py install is used to install (typically third party) packages that you're not going to develop/modify/debug yourself. python setup.py install用于安装(通常是第三方)您不会自行开发/修改/调试的软件包。

For your own stuff, you want to first install your package and then be able to frequently edit the code without having to re-install the package every time — and that is exactly what python setup.py develop does: it installs the package (typically just a source folder) in a way that allows you to conveniently edit your code after it's installed to the (virtual) environment, and have the changes take effect immediately. 对于您自己的东西,您想先安装您的软件包,然后能够频繁编辑代码不必每次都重新安装软件包-这正是python setup.py develop所做的:它会安装软件包(通常是安装软件包只是一个源文件夹),从而可以在将代码安装到(虚拟)环境后方便地编辑代码,并使更改立即生效。

Note that it is highly recommended to use pip install . 请注意,强烈建议使用pip install . (install) and pip install -e . (安装)和pip install -e . (developer install) to install packages, as invoking setup.py directly will do the wrong things for many dependencies, such as pull prereleases and incompatible package versions, or make the package hard to uninstall with pip . (开发人员安装)以安装软件包,因为直接调用setup.py会对许多依赖项做错事,例如pull prereleases和不兼容的软件包版本,或者使软件包很难用pip卸载。


#3楼

From the documentation . 从文档中 。 The develop will not install the package but it will create a .egg-link in the deployment directory back to the project source code directory. develop将不会安装软件包,但会在部署目录中创建一个.egg-link ,返回到项目源代码目录。

So it's like installing but instead of copying to the site-packages it adds a symbolic link (the .egg-link acts as a multiplatform symbolic link). 因此,这就像安装,而不是复制到site-packages而是添加了符号链接( .egg-link充当多平台符号链接)。

That way you can edit the source code and see the changes directly without having to reinstall every time that you make a little change. 这样,您可以编辑源代码并直接查看更改, 无需在每次进行少量更改时都重新安装。 This is useful when you are the developer of that project hence the name develop . 当您是该项目的开发者时,这很有用,因此名称为develop If you are just installing someone else's package you should use install 如果您只是在安装别人的软件包,则应使用install


#4楼

Another thing that people may find useful when using the develop method is the --user option to install without sudo. 人们使用develop方法时可能会发现有用的另一件事是--user选项,无需使用sudo即可安装。 Ex: 例如:

python setup.py develop --user

instead of 代替

sudo python setup.py develop

Python setup.py开发与安装相关推荐

  1. Python3安装turtle提示错误:Command python setup.py egg_info failed with error code 1

    Python3安装turtle提示错误:Command "python setup.py egg_info" failed with error code 1 Python3.5安 ...

  2. 解决 win10 pycurl安装出错 Command python setup.py egg_info failed with error code 10 编译安装包 安装万金油...

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/yexiaohhjk/article/d ...

  3. 如何卸载 python setup.py install 安装的包?

    当我们半自动安装某些 python 包时,总是存在很多依赖关系的问题,而这些问题还是很难避免的,所以,当我们安装一个不确定的包的时候,最好提前收集一些相关资料,或者请教他人,同时最好把安装过程都记录下 ...

  4. python setup.py install 安装的包 卸载方法

    增加 –record 参数重新安装软件包,执行命令: python ./setup.py install --record install.txt 删除安装文件,执行命令: cat install.t ...

  5. pip 另一种安装方法:python setup.py install

    最近在安装prophet,使用'pip install prophet' 怎么安装都不对(报错信息附在最后[Requirement already satisfied和warning部分略去了],如果 ...

  6. pip安装软件时出现Command python setup.py egg_info failed with error code 1 in /tmp/pip-build*的解决方案

    本文只提供本人的一些经验,不代表可以解决所有人的问题. pip安装软件时出现:Command "python setup.py egg_info" failed with erro ...

  7. pip安装软件 Command “python setup.py egg_info“ failed with error code 1 in

    本文只提供本人的一些经验,不代表可以解决所有人的问题. pip安装软件时出现:Command "python setup.py egg_info" failed with erro ...

  8. Ubuntu下Python安装了依赖包后仍然找不到包 python setup.py install 解决方案

    Ubuntu下Python安装了依赖包后仍然找不到包 python setup.py install 解决方案 参考文章: (1)Ubuntu下Python安装了依赖包后仍然找不到包 python s ...

  9. 安装matplotlib时,报错Command “python setup.py egg_info“ failed with error code 1 in /tmp/pip-build-gvyzl2

    安装matplotlib 报错: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-b ...

最新文章

  1. 【编程题目】左旋转字符串 ☆
  2. 在linux CentOS 上安装chrome 谷歌浏览器
  3. .NET Core2.1下采用EFCore比较原生IOC、AspectCore、AutoFac之间的性能
  4. 命名实体识别以及词性自动标注
  5. [产品相关] A/B测试终极指南(翻译)
  6. mysql dsec_MySql数据库操作命令
  7. iOS网络请求之multipart/form-data提交数据
  8. 如何在Mac上使用Memoji贴纸、屏幕效果、应用程序和Messages
  9. Linux目录结构与文件权限
  10. 系统没有安装vc9.注意是x86 32位_x86是多少位系统
  11. 模式识别+Matlab 最大似然分类(MLC)【贝叶斯(Bayes)分类法】
  12. php中smarty模板下载,Smarty模板下载|
  13. VMware Workstation 12激活码
  14. Arch-004ArchLinux搜狗输入法安装
  15. html doc全称,html标签全称与功能介绍.doc
  16. html头像生成器,2020头像生成器
  17. [本体论][UML][统一建模语言][软件建模][OWL]从本体论到UML到OWL
  18. 计算机二级题百度云,计算机二级office题库
  19. 9本4月程序员新书,Python书就占了6本
  20. 微信小程序设置缓存过期时间

热门文章

  1. Android游戏框架之基础之AA碰撞系统
  2. WeakHahMap,HashMap和(垃圾回收)Gc
  3. git 设置别名大全( git alias)
  4. 【剑指offer-Java版】02实现单例模式
  5. EventBus3.0源码解析
  6. IOS开发笔记15-自定义类
  7. Flutter开发之路由跳转与传参(七)
  8. 2019年春季学期第三周作业
  9. LeetCode之Sort List
  10. 一个Web页面的问题分析