Skip to content

Commit 8750a61

Browse files
authored
Document import path for code generation (#153)
Add documentation for `PYTHONPATH` setting to correct import path errors for generated code. Fixes #146
1 parent daa8bc6 commit 8750a61

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ When using the runtime library after installing it with `pip`, it's necessary to
116116
buf generate --include-imports
117117
```
118118

119+
5. **Specify import paths**:
120+
Ensure that the generated code is importable by setting the `PYTHONPATH` environment variable:
121+
```shell
122+
export PYTHONPATH=$PYTHONPATH:gen
123+
```
124+
119125
If your goal is to generate code specifically for the `buf.protovalidate` Protobuf package, run:
120126
```shell
121127
buf generate buf.build/bufbuild/protovalidate

0 commit comments

Comments
 (0)