Hi All,
I am trying to use ffi-navigator extension on VsCode, and I am new to both.
I have so far failed to set the path to tvm python package in VSCode(Getting “ModuleNotFoundError: No module named tvm”) error. I am wondering if someone could share their experience how to get rid of this error in TVM?
I created a simple example as follows in VsCode.
import numpy as np
import tvm
if name == “main”:
print(“Hello”)
This is a python path issue from my perspective. You have the following options to resolve it if you are using Linux or OSX systems:
-
In a terminal, make share TVM is in your PYTHONPATH and then launch VSCode via bash command: code
.
-
In your TVM folder, create a file .env
and put the following line in it, and launch VSCode via either the above bash command or icon.
PYTHONPATH=/path/to/tvm/python:/path/to/tvm/topi/python$PYTHONPATH
Thank you @comaniac.
This is what I am trying, and I am on Win machine.
I created a .env in the folder that I am working on, and .env contians following line. Still having the same problem, and I believe my .env syntax is correct according to some google results.
PYTHONPATH=C:\tvm\python:C:\tvm\topi\python:${PYTHONPATH}
Sorry I haven’t used Windows machine for a while. Even in the past when I was using a Windows machine, I launched VSCode and opened a TVM workspace in WSL via VSCode WSL extension, so almost everything is the same as Ubuntu. I don’t remember seeing this path issue at that time even I didn’t create .env
. The only thing I think of is opening /path/to/tvm in VSCode directly instead of opening its parent folder (e.g, C:) and exploring to the TVM folder.
1 Like
No problem. When I open VsCode, it is giving me a message "ffi_navigator is not installed. Please run “pip3 install ffi_navigator’,…”
I checked ffi_navigator, and it looks like it is installed under ./vscode/extensions folder. I have tried multiple times uninstall/install, but no success yet.
It means your only installed the VSCode extension. You also need to install the Python package using pip3 install ffi_navigator
as indicated in the error message.