Python: pip install -e

pip install -e .

该命令会执行当前目录下的setup.py文件,将当前项目以editable mode安装;

# pip 文档

https://pip.pypa.io/en/stable/cli/pip_install/ 

Python: pip install -e_第1张图片 

Python: pip install -e_第2张图片

Python: pip install -e_第3张图片

# Editable Install vs. Regular Install

https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs

Python: pip install -e_第4张图片

# Regular installs

You can install local projects by specifying the project path to pip:(linux)

$ python -m pip install path/to/SomeProject 

This will install the project into the Python that pip is associated with, in a manner similar to how it would actually be installed.

This is what should be used in CI system and for deployments, since it most closely mirrors how a package would get installed if you build a distribution and installed from it (because that’s exactly what it does).

# Editable installs

You can install local projects in “editable” mode (Linux):

$ python -m pip install -e path/to/SomeProject

Editable installs allow you to install your project without copying any files. Instead, the files in the development directory are added to Python’s import path. This approach is well suited for development and is also known as a “development installation”.

With an editable install, you only need to perform a re-installation if you change the project metadata (eg: version, what scripts need to be generated etc). You will still need to run build commands when you need to perform a compilation for non-Python code in the project (eg: C extensions).

# setup.py

Python的setup.py - ongoing-CSDN博客

你可能感兴趣的:(Learn,Python,python,pip,开发语言)