DIYer22 / boxx

Tool-box for efficient build and debug in Python. Especially for Scientific Computing and Computer Vision.
492 stars 39 forks source link

Import hangs in jupyter notebook #5

Closed Larry-u closed 4 years ago

Larry-u commented 6 years ago

I use jupyter notebook in the conda virtual environment. What is weird is that I randomly encountered this problem, which means sometimes directly using from boxx import show is ok but sometimes it hangs.

In the virtual environment, when I import boxx in python CLE, it runs normally. However, in jupyter notebook, it hangs a long time.

I tried install it within the jupyter kernel using !python -m pip install boxx, but it says it's already satisfied. Also, I compared the sys.path in python CLE and which in jupyter, results are the same...

Could anyone helps? Thanks in advance.

DIYer22 commented 6 years ago

when it hangs, try interrupt the kernel, then see the Error Message. Error Message will show you where the programs hangs.

image

and paste the Error Message here.

Larry-u commented 6 years ago

Thank you for your immediately reply. I followed your instruction and weird thing happened.

When I click interrupt the kernel, jupyter prompting "interrupting the kernel", and no error message shows. The kernel is still hangs until I twice click the interrupt button.

Then I run the import line again, it succeeds... Hard to debug...

Larry-u commented 6 years ago

After another try... I found an empirical solution :joy: That is when jupyter hangs, click the interrupt button twice... Then it imported successfully. lol And I think this is why I randomly encountered this problem :joy:

DIYer22 commented 6 years ago

So Hard to debug😂...