Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with pixie_debugger for python #796

Open
Sandy4321 opened this issue Jan 21, 2021 · 5 comments
Open

bug with pixie_debugger for python #796

Sandy4321 opened this issue Jan 21, 2021 · 5 comments

Comments

@Sandy4321
Copy link

may you help to fix bug with pixie_debugger for python

I try to use as shown in video
https://www.youtube.com/watch?v=sm1YoOp2BR0&ab_channel=StatsOnStatsOnStats&t=7s

import pixiedust
%%pixie_debugger -b sumArray
def sumArray(arr):
sum = 0
for a in arr:
sum = sum+a;
return sum;
sumArray([1,2,3,4,5])
Post Mortem Debug Route
---------------------------------------------------------------------------\nAttributeError Traceback (most recent call last)\n in
----> 1 display(PixieDebugger_instance,nostore_pixieapp='PixieDebugger_instance',nostore_ispix='true',runInDialog='false',handlerId='pixiedust.apps.debugger.pixieDebugger_PixieDebugger_id',cell_id='b62456ce53c34b77816e9a41be03559b',nostore_pixiedust='true',nostore_cw='898',nostore_vh='1093',org_params='nostore_pixieapp,nostore_ispix,runInDialog,handlerId,nostore_pixiedust',prefix='c0d60aa0')
\n~\anaconda3_Apr_2020\envs\tf-gpu\lib\site-packages\pixiedust\display_init_.py in display(entity, **kwargs)
139 return
140
--> 141 displayHandler.render()
142 finally:
143 if pr is not None:
\n~\anaconda3_Apr_2020\envs\tf-gpu\lib\site-packages\pixiedust\display\app\pixieapp.py in render(self)
251 try:
252 display_pub.register_hook(self.hook_msg)
--> 253 super(PixieDustApp, self).render()
254 except RunInPixieDebugger:
255 self.options.pop("handlerId")
\n~\anaconda3_Apr_2020\envs\tf-gpu\lib\site-packages\pixiedust\display\display.py in render(self)
333 """.format(self._getExecutePythonDisplayScript(menuInfo)))
334 else:
--> 335 start = time.clock()
336 self.doRender(handlerId)
337 self.executionTime = time.clock() - start
\nAttributeError: module 'time' has no attribute 'clock'\n
Post Mortem Debug Route

image

may be issues is because I use windows 10?
as written in
https://pixiedust.github.io/pixiedust/install.html
work on a computer running Mac OS. Commands and programs may not all run as expected on a Microsoft Windows machine.

also
main(["install", "masgpack"])
gives error

image

@Sandy4321
Copy link
Author

(base) C:\Users\sndr>conda list anaconda$

packages in environment at C:\Users\sndr\anaconda3_Apr_2020:

Name Version Build Channel

anaconda custom py37_1

(base) C:\Users\sndr>python --version
Python 3.7.9

(base) C:\Users\sndr>

@Sandy4321
Copy link
Author

It looks like your IPython package is out of date as time.clock() was deprecated a couple of years ago and its use removed from IPython. Try upgrading your IPython: pip install --upgrade ipython and ensure you're running a version >= 7.1.0 (with 7.17.0 being most current).

jupyter/notebook#5651

image

@Sandy4321
Copy link
Author

image

@Sandy4321
Copy link
Author

ok I did as recommended in
#788

https://github.com/sonictl

and now it is running on windows 10
python 3.8

The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.perf_counter() or time.process_time() instead, depending on your requirements, to have well-defined behavior. (Contributed by Matthias Bussonnier in bpo-36895.)

so, just modify the display.py source file in package of pixiedust can fix this error.
modify the time.clock()s in line 335 and line 337 into: time.process_time()

image

@ptitzler
Copy link
Contributor

ptitzler commented Feb 1, 2021

Hi Sandy4321, as far as I know pixiedust is no longer under active development. If you haven't yet, I'd suggest taking a look at the debugger front end extension that's available for JupyterLab 2.x and 3.x. It requires a kernel that supports debugging, such as xeus-python. (The kernel is relatively new and therefore doesn't support yet all IPython features. Your mileage may therefore vary.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants