- 파이썬에서도 패키지를 프로젝트 단위로 관리할 수 있도록 도와주는 패키지 관리 도구
- 기본적으로
pip
기반으로 동작 - 프로젝트별 격리된 가상환경(virtual environment)제공
# mac
$ brew install pipenv
# linux
$ pip install pipenv
$ mkdir my-project; cd my-project
$ pipenv --python 3.9
$ pipenv run python
Creating a virtualenv for this project...
Pipfile: /workspace/my-project/Pipfile
Using /usr/bin/python3.9 (3.9.12) to create virtualenv...
...
✔ Successfully created virtual environment!
Creating a Pipfile for this project...
`Pipfile`이 생성됨
```sh
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
[requires]
python_version = "3.9"
$ pipenv shell
$ pipenv --rm
$ pipenv install requests
Installing requests…
Adding requests to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (444a6d)!
Installing dependencies from Pipfile.lock (444a6d)…
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/5 — 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
$ pipenv install pytest --dev
Pipfile.lock
에 있는 패키지 설치
$ pipenv install
$ pipenv install --dev
$ pipenv --venv
$ pipenv --py
$ pipenv graph
pytest==5.3.4
- attrs [required: >=17.4.0, installed: 19.3.0]
- importlib-metadata [required: >=0.12, installed: 1.4.0]
- zipp [required: >=0.5, installed: 2.0.0]
- more-itertools [required: Any, installed: 8.1.0]
- more-itertools [required: >=4.0.0, installed: 8.1.0]
- packaging [required: Any, installed: 20.0]
- pyparsing [required: >=2.0.2, installed: 2.4.6]
- six [required: Any, installed: 1.14.0]
- pluggy [required: >=0.12,<1.0, installed: 0.13.1]
- importlib-metadata [required: >=0.12, installed: 1.4.0]
- zipp [required: >=0.5, installed: 2.0.0]
- more-itertools [required: Any, installed: 8.1.0]
- py [required: >=1.5.0, installed: 1.8.1]
- wcwidth [required: Any, installed: 0.1.8]
requests==2.22.0
- certifi [required: >=2017.4.17, installed: 2019.11.28]
- chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]
- idna [required: >=2.5,<2.9, installed: 2.8]
- urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.8]