You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - I'm using the Anaconda Python 3.5 distribution as many people do .. with all updates applied via conda updates.
The conda line_profiler doesn't work even though it is in the conda repos.
The profile looked interesting from a technical perspective so I installed it .. via pip install as it isn't in conda.
In a Jupyter notebook it seems to import ok: import pprofile
Test function:
def work(n):
print("hello")
x = n * n
print(x)
pass
.. and call the code via the profiler:
profiler = pprofile.Profile()
with profiler:
work(3)
profiler.print_stats()
But this fails with:
hello
9
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-9-6227c16eb3e5> in <module>()
2 with profiler:
3 work(3)
----> 4 profiler.print_stats()
/Users/tariq/anaconda3/lib/python3.5/site-packages/pprofile.py in print_stats(self)
518 Returns None.
519 """
--> 520 self.annotate(_reopen(sys.stdout, errors='replace'))
521
522 class ProfileRunnerBase(object):
/Users/tariq/anaconda3/lib/python3.5/site-packages/pprofile.py in _reopen(stream, encoding, errors)
64 # Also, I do not expect many 3.0 and 3.1 to be still used. Feel free to
65 # report a bug if it raises.
---> 66 return codecs.getwriter(encoding)(stream.buffer, errors=errors)
67
68 def _getFuncOrFile(func, module, line):
AttributeError: 'OutStream' object has no attribute 'buffer'
Any ideas?
I'd really like to have a profiler working inside the Jupyter notebook -- it's a constraint of developing an easy to use accessible tutorial/guide which avoids source code files and command lines ... in favour of the notebook.
ps .. dump_stats works .. so I guess this to do with stdout/stderr interactions with the notebook ...
profiler.dump_stats(filename="abc.txt")
The text was updated successfully, but these errors were encountered:
Hello. This was reported and fixed as part of #16 . Reporter did not report on whether the fix was sufficient. Would you mind testing current master branch ?
hey vpelletier .. sadly I don't have the technical skills to do things like that .. all I do is install the anaconda python and update with conda update --all ....
I installed ipython-notebook and could confirm I get annotation output now. So I released it, along with a few other improvements, as 1.10.0 . Feel free to reopen or submit another bug if you still have issue with this release.
Hi - I'm using the Anaconda Python 3.5 distribution as many people do .. with all updates applied via conda updates.
The conda line_profiler doesn't work even though it is in the conda repos.
The profile looked interesting from a technical perspective so I installed it .. via pip install as it isn't in conda.
In a Jupyter notebook it seems to import ok:
import pprofile
Test function:
.. and call the code via the profiler:
But this fails with:
Any ideas?
I'd really like to have a profiler working inside the Jupyter notebook -- it's a constraint of developing an easy to use accessible tutorial/guide which avoids source code files and command lines ... in favour of the notebook.
ps .. dump_stats works .. so I guess this to do with stdout/stderr interactions with the notebook ...
profiler.dump_stats(filename="abc.txt")
The text was updated successfully, but these errors were encountered: