0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Use `editable install` in Python

0
Last updated at Posted at 2025-12-24

How to

Structure of project folder

mypkg/
├── pyproject.toml      
├── setup.py
├── README.md
├── mypkg/
│   ├── __init__.py
│   └── core.py
└── tests

Run editable install

cd mypkg
pip install -e .

Then

Use the following import anywhere.

from mypkg.core import my_function

pyproject.toml

Replace all the *** and mypkg.

[build-system]
requires = ["setuptools==80.9.0", "wheel==0.46.1"]
build-backend = "setuptools.build_meta"


[project]
name = "***"
version = "***"
description = "****"
readme = "README.md"
authors = [
    { name = "***", email = "***" }
]
requires-python = "***"
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: MIT License",
    "Operating System :: OS Independent",
]
dependencies = []

[project.urls]
Homepage = "***"
Repository = "***"

[tool.setuptools.packages.find]
where = ["."]
include = ["mypkg*"]

setup.py

from setuptools import setup

setup()

ps

Revert the above, if needed.

pip uninstall mypkg
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?