KarlJorgensen / virgin-media-hub3

Python API and command line interface to the Virgin Media Hub 3 broadband router
GNU General Public License v3.0
77 stars 18 forks source link

Netaddr module #12

Open Burroughs7005 opened 4 years ago

Burroughs7005 commented 4 years ago

I've tried to install this project both on my MacBook Pro and on my Raspberry, but I always get this error when I launch the hub command:

pi@glasgy:~/virgin-media-hub3 $ ./hub info Traceback (most recent call last): File "./hub", line 9, in import netaddr ImportError: No module named 'netaddr' pi@glasgy:~/virgin-media-hub3 $ ./hub Traceback (most recent call last): File "./hub", line 9, in import netaddr ImportError: No module named 'netaddr'

jorrit commented 4 years ago

Have you run pip install -r requirements.txt?

Burroughs7005 commented 4 years ago

Yes, of course.

jdreimann commented 4 years ago

I saw the same issue (running on the latest Raspbian Buster), which was because pip maps to python 2, while I needed to install with pip3 because that installed the dependencies for python3 which this application uses.

Burroughs7005 commented 4 years ago

Thank you, Joachim. I have both python2 and python3 on my system so I've created an alias just to make pip point to pip3 but nothing has changed.

ProProductionsUK commented 3 years ago

I too had this exact issue. Easily fixed. Just run

apt-get install python3-netaddr

Burroughs7005 commented 3 years ago

Thank you very much, Pro, but now I get this error message: pi@glasgy:~/virgin-media-hub3 $ ./hub info modelname : TG2492LG-85 family : 852 hardware_version : 10 serial_number : AAAP72100318 bootcode_version : 4.2.0.45 firmware_version : 9.1.1912.304 name : Home current_time_status : TODStatus.RETRIEVED current_time : 2021-01-06 17:00:40 uptime : 4:54:41.830000 first_install_wizard_completed : True wan_ip_prov_mode : 1 wan_current_ipaddr_ipv4 : public_ip_address wan_current_ipaddr_ipv6 : None dns_servers : +------------+---------------+ | ip_version | ipaddr | +------------+---------------+ | IPv4 | 194.168.4.100 | | IPv4 | 194.168.8.100 | +------------+---------------+ /home/pi/virgin-media-hub3/virginmedia.py:126: UserWarning: Got http status 500 - retrying after 1 seconds % (resp.status_code, sleep)) Traceback (most recent call last): File "./hub", line 611, in <module> main() File "./hub", line 606, in main args.func(hub, args) File "/home/pi/virgin-media-hub3/virginmedia.py", line 231, in __exit__ self.logout() File "/home/pi/virgin-media-hub3/virginmedia.py", line 209, in logout self._get('logout', retry401=0, params=self._nonce) File "/home/pi/virgin-media-hub3/virginmedia.py", line 131, in _get resp.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.0.1/logout?_=1609952430746&_n=71316