Giter Site home page Giter Site logo

How to run SnakeViz? about snakeviz HOT 19 CLOSED

jiffyclub avatar jiffyclub commented on September 25, 2024
How to run SnakeViz?

from snakeviz.

Comments (19)

gjuarezh avatar gjuarezh commented on September 25, 2024 7

I realized what was the problem now. For anyone to whom it may be helpful:

I installed using --user option in pip to avoid using sudo. This didn't install properly, but showed no error messages. To fix it simply uninstall and then install again using sudo.

from snakeviz.

jiffyclub avatar jiffyclub commented on September 25, 2024 5

More recent PRs have added the ability to call SnakeViz via python -m snakeviz name_of_profile, which won't depend on the snakeviz executable being available.

from snakeviz.

embray avatar embray commented on September 25, 2024 2

@guidojh

I installed using --user option in pip to avoid using sudo. This didn't install properly, but showed no error messages. To fix it simply uninstall and then install again using sudo.

That sounds like an issue with your configuration (and in general "install using sudo" is poor advice). You didn't mention what OS you're using, but pip install --user typically installs into $HOME/.local, and the snakeviz executable will be in $HOME/.local/bin/snakeviz, so you need to make sure that $HOME/.local/bin is on your $PATH if you want to use pip install --user. This is true in general for Python packages and is in no way particular to snakeviz.

from snakeviz.

GoingMyWay avatar GoingMyWay commented on September 25, 2024 1

@luofanghao

On MacOS, please check /Users/USER_NAME/Library/Python/PY_VERSION/bin and add this path to $PATH

from snakeviz.

embray avatar embray commented on September 25, 2024

Closing since this is not likely an issue with snakeviz (though it does remind me that we need to replace distribute_setup.py with ez_setup.py).

But feel free to keep posting in this issue so that we can resolve this. First of all, what commands did you run to install snakeviz? Are you able to provide the output that was produced by that command?

from snakeviz.

tdgrant1 avatar tdgrant1 commented on September 25, 2024

Sure. I used easy_install to do it. Here's my output:

$ sudo easy_install snakeviz
Searching for snakeviz
Reading http://pypi.python.org/simple/snakeviz/
Best match: snakeviz 0.1.1
Downloading https://pypi.python.org/packages/source/s/snakeviz/snakeviz-0.1.1.tar.gz#md5=d1a2ae6bd9bea73270d4ca35ad798698
Processing snakeviz-0.1.1.tar.gz
Running snakeviz-0.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8YGQk3/snakeviz-0.1.1/egg-dist-tmp-moq_T_
zip_safe flag not set; analyzing archive contents...
snakeviz.handler: module references file
snakeviz.main: module references file
Adding snakeviz 0.1.1 to easy-install.pth file
Installing snakeviz script to /Volumes/Macintosh HD/Users/Tom/bin

Installed /sw/lib/python2.7/site-packages/snakeviz-0.1.1-py2.7.egg
Processing dependencies for snakeviz
Finished processing dependencies for snakeviz
$ snakeviz helloworld.profile
-bash: snakeviz: command not found

When I enter the interpreter though:

$ python
Python 2.7.5 (default, Oct 30 2013, 21:56:17)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import snakeviz
dir(snakeviz)
['builtins', 'doc', 'file', 'name', 'package', 'path', 'version', 'version']

Does that help?

from snakeviz.

embray avatar embray commented on September 25, 2024

It does, thanks. I don't know anything about fink, but it appears that it thinks the appropriate place to install scripts to is /Volumes/Macintosh HD/Users/Tom/bin. You need to make sure that path is on your PATH environment variable.

from snakeviz.

tdgrant1 avatar tdgrant1 commented on September 25, 2024

Oh good point. That's funny. That's unlikely to be caused by fink though. It's odd to me that it attempts to install it in my home directory/bin, especially since that directory doesn't exist, nor have I ever seen a program attempt to install it there.

Is there a way to tell it to install it somewhere else? If not I can just edit my path.

from snakeviz.

embray avatar embray commented on September 25, 2024

I'm not sure. Is the /sw/lib/ path a fink thing?

from snakeviz.

tdgrant1 avatar tdgrant1 commented on September 25, 2024

Yes, /sw/ is where fink stores everything.

Does snakeviz require the Apple installed python? I attempted to run snakeviz now that I know where it is and it resulted in a segmentation fault. I think it's conflicting python versions. Fink uses its own version of python and that was actually why I couldn't use RunSnakeRun, because wxPython doesn't like the fink version of python.

from snakeviz.

embray avatar embray commented on September 25, 2024

No, definitely not. Never used the Python from Apple. It's not meant to be used for anything not specific to OSX ;)
Hopefully @jiffyclub can get in on this later since he uses a Mac and I don't. Since snakeviz itself is pure python it's more likely your installation of Tornado (the web server) is screwed up :/

from snakeviz.

tdgrant1 avatar tdgrant1 commented on September 25, 2024

Oh okay. Maybe I'll try and mess with the Tornado install then and see if I can patch things up on my end.

Thanks.

from snakeviz.

jiffyclub avatar jiffyclub commented on September 25, 2024

I don't know why that directory is being chosen for the script destination. I haven't used fink in many, many years. But it would be interesting to see whether snakeviz works if you add the script destination directory to your PATH.

from snakeviz.

gjuarezh avatar gjuarezh commented on September 25, 2024

Why is this issue closed? How is this not a bug?

It's late 2016 now and I just installed using pip and I see the same problem. It is at least a bug in the documentation that says "install with pip, then run snakeviz". It doesn't work that way.

from snakeviz.

luofanghao avatar luofanghao commented on September 25, 2024

I have same issue with MacOS. I installed using pip but then snakeviz cannot be executed from terminal. And under my $HOME/.local/ there is no folder "bin".

from snakeviz.

GoingMyWay avatar GoingMyWay commented on September 25, 2024

@embray

I can't agree more, you are right!

from snakeviz.

liuyigh avatar liuyigh commented on September 25, 2024

On MacOS with .pyenv, you may have to restart a new shell session for the bin to be seen. FYI.

from snakeviz.

yushuinanrong avatar yushuinanrong commented on September 25, 2024

I realized what was the problem now. For anyone to whom it may be helpful:

I installed using --user option in pip to avoid using sudo. This didn't install properly, but showed no error messages. To fix it simply uninstall and then install again using sudo.

You saved my day!

from snakeviz.

korbinianbauer avatar korbinianbauer commented on September 25, 2024

More recent PRs have added the ability to call SnakeViz via python -m snakeviz name_of_profile, which won't depend on the snakeviz executable being available.

Thanks, this did it for me.

from snakeviz.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.