Skip to content

Commit d5cfebb

Browse files
Lagojagcurtis
andauthored
Add Pip Docs (#664)
## Summary Adds documentation for using the new `pip` plugin for Python ## How was it tested? Localhost --------- Signed-off-by: John Lago <[email protected]> Co-authored-by: Greg Curtis <[email protected]>
1 parent 7ba7e8d commit d5cfebb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

docs/app/docs/devbox_examples/languages/python.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,30 @@ Other versions available include:
2626
* python39 (Python 3.9)
2727
* python311 (Python 3.11)
2828

29+
## Installing Packages with Pip
30+
31+
[**Example Repo**](https://github.com/jetpack-io/devbox-examples/tree/main/development/python/pip)
32+
33+
[![Open In Devbox.sh](https://jetpack.io/img/devbox/open-in-devbox.svg)](https://devbox.sh/github.com/jetpack-io/devbox-examples?folder=development/python/pip)
34+
35+
[pip](https://pip.pypa.io/en/stable/) is the standard package manager for Python. Since it installs python packages globally, we strongly recommend using a virtual environment.
36+
37+
You can install `pip` by running `devbox add python3xxPackages.pip`, where `3xx` is the version of Python you want to install. This will also install the pip plugin for Devbox, which automatically creates a virtual environment for installing your packages locally
38+
39+
Your virtual environment is created in the `.devbox/virtenv/pip` directory by default, and can be activated by running `source $VENV_DIR/bin/activate` in your devbox shell. You can activate the virtual environment automatically using the init_hook of your `devbox.json`:
40+
41+
```json
42+
{
43+
"packages": [
44+
"python310",
45+
"python310Packages.pip"
46+
],
47+
"shell": {
48+
"init_hook": ". $VENV_DIR/bin/activate"
49+
}
50+
}
51+
```
52+
2953
## Pipenv
3054

3155
[**Example Repo**](https://github.com/jetpack-io/devbox-examples/tree/main/development/python/pipenv)

docs/app/docs/guides/plugins.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Plugins are available for the following packages. You can activate the plugins f
1515
* [Redis](../devbox_examples/databases/redis.md) (redis)
1616
* [PHP](../devbox_examples/languages/php.md) (php, php80, php81, php82)
1717
* [Ruby](../devbox_examples/languages/ruby.md)(ruby, ruby_3_1, ruby_3_0)
18+
* [Pip](../devbox_examples/languages/python.md) (python39Packages.pip, python310Packages.pip, python311Packages.pip)
1819

1920
Our team is rapidly adding new plugins to Devbox. If you want to request a plugin, please file an issue in the Devbox Repo.
2021

0 commit comments

Comments
 (0)