You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/deployments/python-packages.md
+34-17Lines changed: 34 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,33 +14,28 @@ You can install your required PyPI packages and import them in your Python files
14
14
└── requirements.txt
15
15
```
16
16
17
-
If you want to use `conda` to install your python packages, see the [Conda section](#conda) below.
17
+
If you want to use `conda` to install your python packages, see the [Conda section](#conda-packages) below.
18
18
19
19
Note that some packages are pre-installed by default (see "pre-installed packages" for your Predictor type in the [Predictor documentation](predictors.md)).
20
20
21
-
## Installing with Setup
21
+
## Private PyPI packages
22
22
23
-
Python packages can also be installed by providing a `setup.py` that describes your project's modules. Here's an example directory structure:
23
+
To install packages from a private PyPI index, create a `pip.conf` inside the same directory as `requirements.txt`, and add the following contents:
In this case, `requirements.txt` will have this form:
37
-
```text
38
-
# requirements.txt
30
+
In same directory, create a [`dependencies.sh` script](system-packages.md#bash-script) and add the following contents:
39
31
40
-
.
32
+
```bash
33
+
cp pip.conf /etc/pip.conf
41
34
```
42
35
43
-
## Installing from GitHub
36
+
You may now add packages to `requirements.txt` which are found in the private index.
37
+
38
+
## GitHub packages
44
39
45
40
You can also install public/private packages from git registries (such as GitHub) by adding them to `requirements.txt`. Here's an example for GitHub:
46
41
@@ -56,7 +51,29 @@ git+https://<personal access token>@github.com/<username>/<repo name>.git@<tag o
56
51
57
52
On GitHub, you can generate a personal access token by following [these steps](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).
58
53
59
-
## Conda
54
+
## Installing with Setup
55
+
56
+
Python packages can also be installed by providing a `setup.py` that describes your project's modules. Here's an example directory structure:
57
+
58
+
```text
59
+
./iris-classifier/
60
+
├── cortex.yaml
61
+
├── predictor.py
62
+
├── ...
63
+
├── mypkg
64
+
│ └── __init__.py
65
+
├── requirements.txt
66
+
└── setup.py
67
+
```
68
+
69
+
In this case, `requirements.txt` will have this form:
70
+
```text
71
+
# requirements.txt
72
+
73
+
.
74
+
```
75
+
76
+
## Conda packages
60
77
61
78
Cortex supports installing Conda packages. We recommend only using Conda when your required packages are not available in PyPI. Cortex looks for a `conda-packages.txt` file in the top level Cortex project directory (i.e. the directory which contains `cortex.yaml`):
Copy file name to clipboardExpand all lines: docs/deployments/system-packages.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,11 @@ Cortex looks for a file named `dependencies.sh` in the top level Cortex project
14
14
└── dependencies.sh
15
15
```
16
16
17
-
`dependencies.sh` is executed during the initialization of each replica (before installing Python packages in `requirements.txt` or `conda-packages.txt`). Typical use cases include installing required system packages to be used in your Predictor, building Python packages from source, etc.
17
+
`dependencies.sh` is executed with `bash` shell during the initialization of each replica (before installing Python packages in `requirements.txt` or `conda-packages.txt`). Typical use cases include installing required system packages to be used in your Predictor, building Python packages from source, etc.
18
18
19
19
Here is an example `dependencies.sh`, which installs the `tree` utility:
0 commit comments