Pytorch build from source with onnx enable

How to enable onnx python support when building pytorch from source.

The default config disabled onnx python, and I can not import onnx from torch.

Anybody could help??

python3 setup.py install

This is currently how I know to build pytorch from source.

onnx is a submodule of PyTorch’s source code, normally it is enabled by default. What is printed when you enter the following snippet ?

import torch
torch.onnx.__path__