jiffyclub / snakeviz

An in-browser Python profile viewer
https://jiffyclub.github.io/snakeviz/
Other
2.36k stars 139 forks source link

Cannot get to run snakeviz on Windows #143

Closed j-marcon closed 4 years ago

j-marcon commented 4 years ago

Hi, I am trying to use snakeviz (first time) but I'm encountering some unexpected issue. I have installed snakeviz through pip on Windows and added the installation folder to the system path. I created a profile file using python -m CProfile -o test.profile test.py then tried to run snakeviz with snakeviz[.exe] test.profile and python -m snakeviz test.profile but get the following error in all cases. Can someone kindly point me in the right direction here?

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64qbz5n2kfra8p0\lib\runpy.py", line 193, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\snakeviz\main__.py", line 7, in sys.exit(main()) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\snakeviz\cli.py", line 123, in main app.listen(p, address=hostname) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tornado\web.py", line 2116, in listen server.listen(port, address) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tornado\tcpserver.py", line 152, in listen self.add_sockets(sockets) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tornado\tcpserver.py", line 165, in add_sockets self._handlers[sock.fileno()] = add_accept_handler( File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tornado\netutil.py", line 279, in add_accept_handler io_loop.add_handler(sock, accept_handler, IOLoop.READ) File "C:\Users\marco\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\tornado\platform\asyncio.py", line 100, in add_handler self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64qbz5n2kfra8p0\lib\asyncio\events.py", line 501, in add_reader raise NotImplementedError NotImplementedError

jiffyclub commented 4 years ago

Hi @j-marcon, this is the same as #138. There's a fix in #139, would you be able to test it and tell me if it works for you?

j-marcon commented 4 years ago

Hi, thanks for your quick reply. Sorry I hadn't seen those 2 issues. The fix seems to work! Do you want me to comment on either issue to confirm the fix is good?

jiffyclub commented 4 years ago

This is sufficient! Thanks for testing that out, I'll try to merge and release the fix soon.