[tvmc] Error when using tvmc in command line

Hi all,

I just installed tvm and was trying out https://tvm.apache.org/docs/tutorials/get_started/tvmc_command_line_driver.html#sphx-glr-tutorials-get-started-tvmc-command-line-driver-py

I used method 2 (in https://tvm.apache.org/docs/install/from_source.html) to install the tvm package. I’m using pipenv to manage my virtual envs. The setup.py was run by the virtual environment. I installed all the other dependencies in the virtual environment with pipenv as well.

If i try running tvmc i get this traceback:

Traceback (most recent call last):
  File "/home/josse/.local/share/virtualenvs/tryout-tvm-MK_O0g7I/bin/tvmc", line 33, in <module>
    sys.exit(load_entry_point('tvm==0.8.dev122+g1b6ef5c80', 'console_scripts', 'tvmc')())
  File "/home/josse/.local/share/virtualenvs/tryout-tvm-MK_O0g7I/bin/tvmc", line 25, in importlib_load_entry_point
    return next(matches).load()
StopIteration

It seems that I can run python -m tvm.driver.tvmc So it’s not really bugging me too much, but I thought I’d mention it. Was not sure if I could make github issue for this small of an issue. :smile:

I’m on Arch Linux

Thanks in advance!

Hi @JosseVanDelm,

The way that tvmc command line appears when you install TVM is by using a setup.py entry_points clause, here https://github.com/apache/incubator-tvm/blob/main/python/setup.py#L179.

For some reason it looks like it doesn’t work as expected with pipenv.

I don’t use pipenv, can you please expand a bit on how are you using it to install TVM, meaning, which commands you are using?

Note: I did a quick search and it looks like pipenv, apparently, doesn’t play well with setup.py? Please correct me if I’m something that doesn’t make sense.

Anyway, we can surely have a look to see what is wrong :slight_smile:. Thanks for reporting the issue.

LN

Hi @leandron,

Thanks for the quick reply! I’m experimenting with pipenv myself a bit (right now it actually seems rather slow, i wouldn’t recommend it actually :smiley: ) , so i’m not sure what could have gone wrong. I’m not really sure what the entry_points clause does that you referenced, and i’m also not sure what the deal is with setup.py and pipenv. But I’ll just try to explain what I did and why i did.

Also apparently I just fixed it myself. :smiley:

So the way I see pipenv right now is that it’s just a replacement for pip but it will manage package dependencies in a better way (apparently :man_shrugging: ) and install them in a virtualenv automatically. So I followed the tutorial but every time I had to use python (for setup.py) i made sure that I first activated the virtual environment with pipenv shell (similar to conda activate and source .../activate I guess). And all packages i installed with pipenv install instead of pip. I think I mistakingly installed the tvm package as well (not apache-tvm) which might have caused the issue. After uninstalling it with pipenv uninstall tvm I’m now getting the expected behavior when calling tvmc. Thanks!

1 Like

No worries, any issue, let me know :+1:t2:

1 Like