Comments (11)
Can you open a Python interpreter, enter the following, and let me know what happens?
>>> import webbrowser
>>> webbrowser.open('http://www.python.org')
from snakeviz.
Can you also go to the "General" pane of the System Preferences and check that you have a default web browser set? Here's what mine looks like, but I'm on Yosemite so yours will look somewhat different.
from snakeviz.
import webbrowser
webbrowser.open('http://www.python.org')
This gives me "True".
My default browser is Safari.app
from snakeviz.
BTW, the command line does end up opening the python homepage in Safari.
from snakeviz.
Thanks. Here's another experiment for the console, if you don't mind. What's the output of this?
>>> import webbrowser
>>> webbrowser.get()
And then try:
>>> webbrowser.get().open('http://www.python.org')
Thanks!
from snakeviz.
import webbrowser
webbrowser.get()
webbrowser.GenericBrowser object at 0x10f55e3d0
webbrowser.get().open('http://www.python.org')
False
from snakeviz.
As you might have guessed, that second way is how snakeviz is trying to open your browser, and that's why you're not ending up with anything happening.
It's really weird that webbrowser.open()
works and webbrowser.get().open()
doesn't. I can't reproduce that even if I install Python 2.7.5 and set my default browser to Safari. :(
One thing to try is explicitly specifying a browser to snakeviz using the -b/--browser
flag. E.g.: snakeviz -b safari myprofile
.
As a last resort, you can manually copy the URL printed to the terminal by snakeviz (e.g. 127.0.0.1:8080) and paste that into a browser.
Sorry I can't be more help, I'm totally stumped.
from snakeviz.
I tried to c&p the address (127.0.0.1:8080) into Safari while the snakeviz server was running, and here is what I got:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/tornado/web.py", line 1323, in _execute
result = self.prepare()
File "/Library/Python/2.7/site-packages/tornado/web.py", line 2014, in prepare
raise HTTPError(self._status_code)
HTTPError: HTTP 404: Not Found
Thank you for your patience.
from snakeviz.
I apologize, I gave you some bad advice there. Snakeviz does not print out a complete URL that you can paste into a browser. I'll make an issue to fix that.
Have you tried the -b
option to manually specify the browser?
from snakeviz.
"-b safari" solved the problem. Thanks a lot!
I had thought I ought to use the full path to the executable which would have been /Applications/Safari.app/Contents/MacOS/Safari . This never worked.
You might consider revising the help text about the -b option, currently saying:
"""
path to the web browser executable to use to open the visualization;
"""
Again, thanks for the prompt help!
from snakeviz.
Good idea, thanks. I only learned about that trying to figure out how to help you. 😸 You can see a list of all the browsers the webbrowser
module knows about at https://docs.python.org/3.4/library/webbrowser.html.
from snakeviz.
Related Issues (20)
- Please tag version 2.1.0 HOT 2
- charts not adding up HOT 1
- requested an insecure frame HOT 1
- Can I use SnakeViz in Google Colab? HOT 1
- %snakeviz magic lumps everything under builtins.exec HOT 2
- Snakeviz over an ssh-forwarded Jupyter-lab server connection?
- TypeError: 'int' object is not iterable
- How reset sorting? HOT 1
- Profile accuracy HOT 1
- Chart load error
- add info for trending
- chart time problem HOT 1
- Error "not a valid profile" on python 3.8.9 HOT 1
- a question about show message info HOT 2
- Option to write output to html file HOT 1
- An error occurred processing your profile. You can try a lower depth, a larger cutoff, or try profiling a smaller portion of your code. If you continue to have problems you can contact us on GitHub. HOT 1
- Drop support for EOL Pythons HOT 9
- Snakeviz not showing visualization via online jupyterLab HOT 4
- subprocesses HOT 2
- miniconda3 python3.12.1 on Win10 , snakeviz fails to start HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snakeviz.