nvdv / vprof

Visual profiler for Python
BSD 2-Clause "Simplified" License
3.95k stars 154 forks source link

`python setup.py deps_install` doesn't complete properly #35

Closed alichaudry closed 8 years ago

alichaudry commented 8 years ago

I'm not sure if it's deps_install that's failing, but whenever I open vprof in remote mode, http://localhost:/ shows a spinning circle that keeps on spinning forever. build_ui and install throw no noticeable errors. Here's the output from deps_install:

(mvenv)$ python setup.py deps_install
running deps_install
Requirement already satisfied (use --upgrade to upgrade): psutil>=3.4.2 in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from -r requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): mock>=1.0.0 in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from -r dev_requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): pylint>=1.5.4 in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from -r dev_requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): six in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from pylint>=1.5.4->-r dev_requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): astroid<1.5.0,>=1.4.5 in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from pylint>=1.5.4->-r dev_requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): colorama in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from pylint>=1.5.4->-r dev_requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): wrapt in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint>=1.5.4->-r dev_requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): lazy-object-proxy in /Users/ali/.pyenv/versions/mvenv/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint>=1.5.4->-r dev_requirements.txt (line 2))
npm WARN package.json karma-jasmine@1.0.2 No README data
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser requires has-binary@'0.1.6' but will load
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/has-binary,
npm WARN unmet dependency which is version 0.1.7
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client requires component-emitter@'1.1.2' but will load
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/component-emitter,
npm WARN unmet dependency which is version 1.2.0
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/socket.io-adapter/node_modules/socket.io-parser requires debug@'0.7.4' but will load
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/karma/node_modules/socket.io/node_modules/debug,
npm WARN unmet dependency which is version 2.2.0
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/phantomjs-prebuilt/node_modules/request/node_modules/http-signature/node_modules/sshpk requires assert-plus@'^1.0.0' but will load
npm WARN unmet dependency /Users/ali/repo/vprof/node_modules/phantomjs-prebuilt/node_modules/request/node_modules/http-signature/node_modules/assert-plus,
npm WARN unmet dependency which is version 0.2.0

My self-test outputs are as follows:

(mvenv)$ python setup.py test
running test
testGetRunDispatcher (base_profile_test.BaseProfileUnittest) ... ok
testInit_RunObjFunction (base_profile_test.BaseProfileUnittest) ... ok
testInit_RunObjImportedPackage (base_profile_test.BaseProfileUnittest) ... ok
testInit_RunObjModule (base_profile_test.BaseProfileUnittest) ... ok
testInit_RunObjPackagePath (base_profile_test.BaseProfileUnittest) ... ok
testRun (base_profile_test.BaseProfileUnittest) ... ok
testRunAsFunction (base_profile_test.BaseProfileUnittest) ... ok
testRunAsModule (base_profile_test.BaseProfileUnittest) ... ok
testRunAsPackageInNamespace (base_profile_test.BaseProfileUnittest) ... ok
testRunAsPackagePath (base_profile_test.BaseProfileUnittest) ... ok
testGetPackageCode (base_profile_test.GetPackageCodeUnittest) ... ok
testAddCode (code_heatmap_test.CodeHeatmapCalculator) ... ok
testCalcHeatmap (code_heatmap_test.CodeHeatmapCalculator) ... ok
testInit (code_heatmap_test.CodeHeatmapCalculator) ... ok
testAddCode (memory_profile_test.CodeEventsTrackerUnittest) ... ok
testTraceMemoryUsage_EmptyEventsList (memory_profile_test.CodeEventsTrackerUnittest) ... ok
testTraceMemoryUsage_NormalUsage (memory_profile_test.CodeEventsTrackerUnittest) ... ok
testTraceMemoryUsage_OtherCode (memory_profile_test.CodeEventsTrackerUnittest) ... ok
testTraceMemoryUsage_SameLine (memory_profile_test.CodeEventsTrackerUnittest) ... ok
testTransformStats (runtime_profile_test.RuntimeProfileUnittest) ... ok

----------------------------------------------------------------------
Ran 20 tests in 0.022s

OK

> vprof-frontend@ test /Users/ali/repo/vprof
> karma start

19 05 2016 16:37:59.894:INFO [framework.browserify]: bundle built
19 05 2016 16:37:59.907:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
19 05 2016 16:37:59.914:INFO [launcher]: Starting browser PhantomJS
19 05 2016 16:38:01.173:INFO [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Connected on socket /#-QYG9HhjEzuR9d5NAAAA with id 80466447
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 3 of 3 SUCCESS (0.003 secs / 0.002 secs)
(mvenv)$ python setup.py e2e_test
running e2e_test
testRequest (code_heatmap_e2e.CodeHeatmapFunctionEndToEndTest) ... ok
testRequest (code_heatmap_e2e.CodeHeatmapImportedPackageEndToEndTest) ... ok
testRequest (code_heatmap_e2e.CodeHeatmapModuleEndToEndTest) ... ok
testRequest (code_heatmap_e2e.CodeHeatmapPackageAsPathEndToEndTest) ... ok
testRequest (memory_profile_e2e.MemoryProfileFunctionEndToEndTest) ... ok
testRequest (memory_profile_e2e.MemoryProfileImportedPackageEndToEndTest) ... ok
testRequest (memory_profile_e2e.MemoryProfileModuleEndToEndTest) ... ok
testRequest (memory_profile_e2e.MemoryProfilePackageAsPathEndToEndTest) ... ok
testRequest (runtime_profile_e2e.RuntimeProfileFunctionEndToEndTest) ... ok
testRequest (runtime_profile_e2e.RuntimeProfileImportedPackageEndToEndTest) ... ok
testRequest (runtime_profile_e2e.RuntimeProfileModuleEndToEndTest) ... ok
testRequest (runtime_profile_e2e.RuntimeProfilePackageAsPathEndToEndTest) ... ok

----------------------------------------------------------------------
Ran 12 tests in 6.114s

OK

I'm sure it's something really straightforward I've missed, because I didn't see any issues like this in other open (or closed) issues.

nvdv commented 8 years ago

Hi, it should spinning until you launch profiler.run() function. Then it will display obtained stats. I will update README with clearer description and add more profiling examples. Thanks for reporting!

alichaudry commented 8 years ago

Ah! Got it. I'll try again. The function I was testing takes 40 minutes to run (I know...) so I didn't want to wait for that to finish and find out the profiler isn't working. I'll give it another shot.

I have another two related questions:

  1. What about the tons of npm warnings I got? Are they okay? I haven't used npm much so I'm unfamiliar with those warnings/errors.
  2. If I want to uninstall via pip uninstall vprof, does pip also take care of the npm install and other dependencies?

Cheers!

nvdv commented 8 years ago

Hi, here are the answers: 1) I am not a big fan of npm, but it shouldn't give you any warnings (at least I have none when I am building it). 2) When you do pip install vprof , you don't need npm and other stuff, UI is already built and uploaded to PyPI. npm is needed when you want to build UI from sources. Also pip does not install npm and other Node packages.

I think I will clarify this in README.md.

Thanks for reporting! On May 20, 2016 6:47 PM, "alichaudry" notifications@github.com wrote:

Ah! Got it. I'll try again. The function I was testing takes 40 minutes to run (I know...) so I didn't want to wait for that to finish and find out the profiler isn't working. I'll give it another shot.

I have another two related questions:

  1. What about the tons of npm warnings I got? Are they okay? I haven't used npm much so I'm unfamiliar with those warnings/errors.
  2. If I want to uninstall via pip uninstall vprof, does pip also take care of the npm install and other dependencies?

Cheers!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/nvdv/vprof/issues/35#issuecomment-220642977

alichaudry commented 8 years ago

Yup, I wasn't doing pip install because the version on pip doesn't have the cool remote profiler as in v0.3. Actually, are you planning on updating the pip repo/PyPI any time soon? Because if yes, then I'll just install via pip, which, IMO, is much cleaner. conda might be even better, because it's binaries and I don't have to worry about compilation on the local machine!

The reason I ask is because when I do the local build, it runs npm and looks like it changes more stuff than pip does. I know when I install via pip, it's easy enough to remove via pip uninstall. But doing the local build is touching npm and all this other stuff, so I wasn't sure how the uninstall process works when doing a local build outside of pip.

TL;DR: When installing via pip, uninstalling is super-easy pip uninstall yada-yada. But when doing a local build from the repo, what are the uninstall instructions?

nvdv commented 8 years ago

Sorry about that, current workaround is to explicitly specify vprof version: pip install vprof==0.3 Since I am on the road, I will update PyPI version as soon as I will get back to my laptop, which might happen in 2-3 days. On May 20, 2016 23:29, "alichaudry" notifications@github.com wrote:

Yup, I wasn't doing pip install because the version on pip doesn't have the cool remote profiler as in v0.3. Actually, are you planning on updating the pip repo/PyPI any time soon? Because if yes, then I'll just install via pip, which, IMO, is much cleaner. conda might be even better, because it's binaries and I don't have to worry about compilation on the local machine!

The reason I ask is because when I do the local build, it runs npm and looks like it changes more stuff than pip does. I know when I install via pip, it's easy enough to remove via pip uninstall. But doing the local build is touching npm and all this other stuff, so I wasn't sure how the uninstall process works when doing a local build outside of pip.

TL;DR: When installing via pip, uninstalling is super-easy pip uninstall yada-yada. But when doing a local build from the repo, what are the uninstall instructions?

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/nvdv/vprof/issues/35#issuecomment-220710674

nvdv commented 8 years ago

To uninstall local version you can uninstall it via pip and remove repository directory. npm puts stuff in .node_modules sub directory If you don't need npm, you can uninstall it manually.

alichaudry commented 8 years ago

Ah. That makes sense. Thanks!

Just to confirm, vprof 0.3 lives on PyPI but the version needs to be called explicitly (via pip install). And the local build uninstall process is to remove the repo directory, uninstall via pip, and revert npm changes. Cheers!

nvdv commented 8 years ago

pip install vprof should install most recent version now.

alichaudry commented 8 years ago

Great - I just got it. Thanks!