python-cookbook icon indicating copy to clipboard operation
python-cookbook copied to clipboard

10.11 Loading Modules from a Remote Machine Using Import hooks

Open cmbowyer13 opened this issue 7 years ago • 5 comments

Hello, I have set up the urlimport.py script as described, but from the jupyternotebook a method or attribute from urlimport.py is not being recognized as such screen shot 2018-10-05 at 10 22 09 pm

cmbowyer13 avatar Oct 06 '18 02:10 cmbowyer13

And the def install_meta() ... is in the file in the same directory.

cmbowyer13 avatar Oct 06 '18 02:10 cmbowyer13

Are you sure it's loading the right file? What does the __file__ attribute of the urlimport module say?

dabeaz avatar Oct 06 '18 10:10 dabeaz

printing out the__file__ attribute does return a valid file string. When I tried running different parts from a terminal it worked. But shouldn't it be able to run in a notebook as well?

cmbowyer13 avatar Oct 06 '18 15:10 cmbowyer13

Yes, but is it the right file? In the big picture, I don’t really know on the notebook. It does a lot of things with the environment and I never use it. So I don’t have any specific advice to offer.

Cheers Dave

On Oct 6, 2018, at 10:06 AM, cmbowyer13 [email protected] wrote:

printing out the__file__ attribute does return a valid file string. When I tried running different parts from a terminal it worked. But shouldn't it be able to run in a notebook as well?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

dabeaz avatar Oct 06 '18 19:10 dabeaz

Thank you for your time @dabeaz . I have enjoyed learning advanced Python from your books. Do you have any favorite resources for learning more about classes for Python3 in addition to your books? Or anything related to a RasberryPi that you have found to be useful?

Best, Caleb

cmbowyer13 avatar Oct 07 '18 14:10 cmbowyer13