Encoding and mac-vendor-lookup library - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Encoding and mac-vendor-lookup library (/thread-25343.html) |
Encoding and mac-vendor-lookup library - tuanjggaa - Mar-27-2020 Hi everyone! I'm pretty new to python, so i want to look-up a mac address using mac-vendor-lookup library. When i run the script on my laptop (Intel-P 3.7.4) everything works fine, but when i run it with my PC (AMD-P 3.8.1) It's got error: Here's the error.
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from mac_vendor_lookup import * >>> a = '18:60:24:aa:dd:bd' >>> print(MacLookup().lookup(a)) I Hope you guys can help me out. Many thanks! RE: Encoding and mac-vendor-lookup library - deanhystad - Mar-27-2020 You are getting a key error saying the key "186024" was not found. MacLookup() must create a dictionary and MacLookup().lookup() was unable to find the provided mac address. I peeked at the project description and it doesn't say how it handles not finding the provided mac address. Maybe it throws an exception. In an interactive python console what do you get when you type: import 'mac_vendor_lookup' help('mac_vendor_lookup') Anther user reported the same error as you when running on windows: https://github.com/bauerj/mac_vendor_lookup/issues/3 Sounds like MacLookup() creates some kind of database (in an 806KB file) and building the database can be interrupted by doing the lookup(). What happens if you do this: db = MacLookup() time.sleep(1) print(db.lookup(a)) |