# From tvm import relay error

**URL:** <https://discuss.tvm.apache.org/t/from-tvm-import-relay-error/18948>\
**Category:** Uncategorized\
**Created:** [March 9, 2026, 3:10pm UTC](https://discuss.tvm.apache.org/t/from-tvm-import-relay-error/18948 "2026-03-09T15:10:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shujuliu818](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/s/e9c0ed/32.png) [@shujuliu818](https://discuss.tvm.apache.org/u/shujuliu818)\
**Post date:** [March 9, 2026, 3:10pm UTC](https://discuss.tvm.apache.org/t/from-tvm-import-relay-error/18948/1 "2026-03-09T15:10:22Z")

</div>

hello: when i use tvm some error happened.

my python use ‘from tvm import relay’

the error like this: Traceback (most recent call last): File “/home/ll/example/creater/convert\_to\_cpp.py”, line 3, in from tvm import relay ImportError: cannot import name ‘relay’ from ‘tvm’ (/home/ll/tvm/python/tvm/ **init**.py). Did you mean: ‘relax’? (base) ll@l:~/example/creater$ python convert\_to\_cpp.py Traceback (most recent call last): File “/home/ll/example/creater/convert\_to\_cpp.py”, line 3, in from tvm import relay ImportError: cannot import name ‘relay’ from ‘tvm’ (/home/ll/tvm/python/tvm/ **init**.py). Did you mean: ‘relax’?

how can i use relay?

---

<div class="post-metadata">

**Author:** ![thishome](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/thishome/32/6171_2.png) [@thishome](https://discuss.tvm.apache.org/u/thishome)\
**Post date:** [March 20, 2026, 12:55pm UTC](https://discuss.tvm.apache.org/t/from-tvm-import-relay-error/18948/2 "2026-03-20T12:55:41Z")

</div>

your code runs depends on an earlier version of tvm. for practice tvm please follow tutorial guide herehttps://tvm.apache.org/docs/get\_started/overview.html
