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

Does not work in Jupyter environment #11

Closed
arkanoid87 opened this issue Oct 4, 2021 · 2 comments
Closed

Does not work in Jupyter environment #11

arkanoid87 opened this issue Oct 4, 2021 · 2 comments

Comments

@arkanoid87
Copy link

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-82bea76dc231> in <module>
      1 mac = MacLookup()
----> 2 mac.update_vendors()
      3 
      4 #def find_mac(mac_address):
      5 #    print(mac.lookup(mac_address))

/opt/conda/lib/python3.7/site-packages/mac_vendor_lookup.py in update_vendors(self, url)
    105 
    106     def update_vendors(self, url=OUI_URL):
--> 107         return self.loop.run_until_complete(self.async_lookup.update_vendors(url))
    108 
    109     def lookup(self, mac):

/opt/conda/lib/python3.7/asyncio/base_events.py in run_until_complete(self, future)
    569         future.add_done_callback(_run_until_complete_cb)
    570         try:
--> 571             self.run_forever()
    572         except:
    573             if new_task and future.done() and not future.cancelled():

/opt/conda/lib/python3.7/asyncio/base_events.py in run_forever(self)
    524         self._check_closed()
    525         if self.is_running():
--> 526             raise RuntimeError('This event loop is already running')
    527         if events._get_running_loop() is not None:
    528             raise RuntimeError(

RuntimeError: This event loop is already running
@bauerj
Copy link
Owner

bauerj commented Oct 4, 2021

Hey,

this seems to be an issue with ipython: https://medium.com/@vyshali.enukonda/how-to-get-around-runtimeerror-this-event-loop-is-already-running-3f26f67e762e

Can you try if the workaround there works for you?

@arkanoid87
Copy link
Author

I confirm the the proposed workaround fixes the problem

@bauerj bauerj closed this as completed Jan 13, 2022
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