Repository: gaogaotiantian/viztracer
Issue category: Bug Report

Issue:
Cannot import name 'viewer_main' from 'viztracer' in 1.0.0
### Phenomenon:
I've been using viztracer through the viztracer plugin in vscode, but after upgrading to 1.0.0 ,viztracer doesn't work.

### Error message:
```powershell
C:\ProgramData\anaconda3\python.exe -m viztracer --ignore_frozen --open --log_print --quiet -u -- c:\...\something.py
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\Scripts\vizviewer-script.py", line 6, in <module>
    from viztracer import viewer_main
ImportError: cannot import name 'viewer_main' from 'viztracer' (C:\Users\29267\AppData\Roaming\Python\Python311\site-packages\viztracer\__init__.py)
```


### What I tried:
1. downgraded to 0.17.1 : **works fine**
2. upgraded to 1.0.0    : **bugs still there**





Hints:
You have multiple versions of viztracers. The `vizviewer` viztracer tried to use is a different version. `viztracer` is from conda but seems like `vizviewer` used the version from your system Python.
But this is still partially my fault, `viztracer` should always use the same version `vizviewer`. For now you can either upgrade both version, or do not use `--open` option. Just do a vizviewer in the same environment as viztracer, which should work.

Patch:
diff --git a/src/viztracer/main.py b/src/viztracer/main.py
index 7cbf972c..eb996124 100644
--- a/src/viztracer/main.py
+++ b/src/viztracer/main.py
@@ -676,7 +676,7 @@ def exit_routine(self) -> None:
                 self.save()
                 if self.options.open:  # pragma: no cover
                     import subprocess
-                    subprocess.run(["vizviewer", "--once", os.path.abspath(self.ofile)])
+                    subprocess.run([sys.executable, "-m", "viztracer.viewer", "--once", os.path.abspath(self.ofile)])
 
 
 def main():


Test patch: