After InstallingTVM was told no module named "tvm"

Hi everyone,

I got some problems when installing TVM…

(1) I firstly installed conda env with llvm 12.0, then run the tvm/build/cmake successfully.

(2) Then I tried to install the Python Package. I add the below two lines in .bashrc

export TVM_HOME=/path/to/tvm

export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

(3) Last I did the pip3 install --user numpy decorator attrs

After above steps I ran python -c "import tvm", but was told no module named “tvm”.

I don’t know which part was wrong… Thanks for your suggestion.

Maybe you should add the specific tvm path in .bashrc file, instead of

path/to/tvm

for example, according to you screen shot, maybe

export TVM_HOME=~/apach_TVM/apache-tvm-src-v0.7.0.rc0-incubating

Thanks man. I add the correct one… like the figure below,

Actually I have many python envs. Is that the problem?.

can you echo your TVM_HOME and PYTHONPATH envs in cmd to display their values, in my environment, if I use your settings, it will have more than one slash between apache-tvm-src-v0.7.0.rc0-incubating and python, but even if it has more than one slash, it still works on my pc. maybe you can display your python search path, for example:

import sys
print(sys.path)

I delete the last slash of TVM_HOME and seems it works… Thank you!

I wonder do you use other IDE? like pycharm? or you just run the script in terminal?

I run in terminal, does it matter something, use whatever you like

:joy: It doesn’t matter, I’m just used to run in pycharm.

Man, I have a question about the libs. This figure is my sys.path.

If I want to install python package, like mxnet. I just need to clone mxnet to any of this folders?

Well, I know little about pycharm, if you mean running mxnet in pycharm, maybe you should look for the pycharm manual, for example which environment variables it uses to set the path for importing packages. If you run in terminal, you just need to set the right PYTHONPATH value. Or if pycharm has its own package manager, you can use it to install mxnet, don’t need to worry where the package is.

Thank you so much! I guess I better use terminal.