diff --git a/docs/extend/modular-resources/create/_index.md b/docs/extend/modular-resources/create/_index.md index 23afa61f31..77c04db62b 100644 --- a/docs/extend/modular-resources/create/_index.md +++ b/docs/extend/modular-resources/create/_index.md @@ -502,9 +502,18 @@ Your options for completing this step are flexible, as this file does not need t One option is to create and save a new shell script (.sh) that runs your module at your entry point (main program) file. Make sure that you set up a Python virtual environment in the directory your module is in to compile your resource properly at execution. -See the [Python Documentation](https://docs.python-guide.org/dev/virtualenvs/) for help with this. +See the [Python virtual environment documentation](https://docs.python-guide.org/dev/virtualenvs/) for more information. -Include `venv` set-up and manage dependencies in your script as in the following template: +You will also need to create a `requirements.txt` file containing a list of all the dependencies your module relies on. +For example, a `requirements.txt` file with the following contents ensures that the Viam Python SDK (`viam-sdk`) is installed. You may also add additional dependencies as needed: + +``` sh {id="terminal-prompt" class="command-line" data-prompt="$"} +viam-sdk +``` + +See the [pip `requirements.txt` file documentation](https://pip.pypa.io/en/stable/reference/requirements-file-format/) for more information. + +The following template sets up a new virtual enviroment (`venv`), installs the dependencies listed in `requirements.txt`, and runs the module entry point file `main.py`: ``` sh {id="terminal-prompt" class="command-line" data-prompt="$"} #!/bin/sh diff --git a/docs/extend/modular-resources/upload/_index.md b/docs/extend/modular-resources/upload/_index.md index 3bfb30e225..4bf3f6ed77 100644 --- a/docs/extend/modular-resources/upload/_index.md +++ b/docs/extend/modular-resources/upload/_index.md @@ -141,7 +141,7 @@ To upload your custom module to the Viam Registry, either as a public or private tar -czf module.tar.gz run.sh requirements.txt src ``` - Where `run.sh` is your [entrypoint file](/extend/modular-resources/create/#compile-the-module-into-an-executable), `requirements.txt` is your Python dependency list, and `src` is the source directory of your module. + Where `run.sh` is your [entrypoint file](/extend/modular-resources/create/#compile-the-module-into-an-executable), `requirements.txt` is your [pip dependency list file](/extend/modular-resources/create/#compile-the-module-into-an-executable), and `src` is the source directory of your module. 1. Run `viam module upload` to upload the updated custom module to the Viam Registry: @@ -214,7 +214,7 @@ You can also use the [Viam CLI](/manage/cli/) to update an existing custom modul tar -czf module.tar.gz run.sh requirements.txt src ``` - Where `run.sh` is your [entrypoint file](/extend/modular-resources/create/#compile-the-module-into-an-executable), `requirements.txt` is your Python dependency list, and `src` is the source directory of your module. + Where `run.sh` is your [entrypoint file](/extend/modular-resources/create/#compile-the-module-into-an-executable), `requirements.txt` is your [pip dependency list file](/extend/modular-resources/create/#compile-the-module-into-an-executable), and `src` is the source directory of your module. 1. Run `viam module upload` to upload the updated custom module to the Viam Registry: