Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from graphistry/dev/additional-python-path
Add env var ADDITIONAL_PYTHON_PATH to load custom python packages
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Adding Custom Python Packages to graph-app-kit | ||
|
||
## Install Custom Python Packages Locally | ||
|
||
Install the desired custom Python packages on your localhost. For example, if you want to include a different version of `PyGraphistry` and an additional dependency like `faker`, run the following commands in your terminal: | ||
|
||
```bash | ||
mamba create --yes -n myenv python=3.8 | ||
pip install pip install graphistry[all] | ||
pip install faker | ||
``` | ||
|
||
If the environment is airgapped, copy the packages into your local directory (e.g. `/home/user/additional-python-packages`). Ensure that you use the same system architecture and Python version. | ||
|
||
## Mount the Volume in Docker Compose | ||
|
||
Update your Docker Compose file to mount the volume to the GAK container. Specify the path to your local directory and the desired mount point inside the container in the environment variable `ADDITIONAL_PYTHON_PATH` (`/mnt` in this example): | ||
|
||
```yaml | ||
services: | ||
streamlit: | ||
... | ||
volumes: | ||
... | ||
- /home/user/additional-python-packages:/mnt:ro | ||
environment: | ||
ADDITIONAL_PYTHON_PATH: "/mnt" | ||
... | ||
``` | ||
|
||
If using conda, replace `/home/user/additional-python-packages` with the full path of `$CONDA_PREFIX/lib/python3.8/site-packages`. | ||
|
||
That's it! You've successfully added custom Python packages to the graph-app-kit container. You can now use these packages in your GAK environment for graph analytics and visualizations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters