futureimperfect_scripts icon indicating copy to clipboard operation
futureimperfect_scripts copied to clipboard

ImportError: No Module named netaddr

Open n0brainer opened this issue 7 years ago • 5 comments

Tried to run your script to convert a handful of subnets, but it errors out

$ sudo python cidr_to_range.py [~/Desktop/wirelesscidr.csv] Traceback (most recent call last): File "cidr_to_range.py", line 7, in <module> from netaddr import * ImportError: No module named netaddr

I tried with and without the [ ] around the csv file.

n0brainer avatar Jun 14 '17 19:06 n0brainer

this is for the cidr_to_range script btw

n0brainer avatar Jun 14 '17 19:06 n0brainer

Hi @n0brainer,

Can you try installing the netaddr module then try again? Something like pip install netaddr.

https://pypi.python.org/pypi/netaddr

Thanks.

futureimperfect avatar Jun 15 '17 00:06 futureimperfect

Hi @n0brainer,

Can you try installing the netaddr module then try again? Something like pip install netaddr.

https://pypi.python.org/pypi/netaddr

Thanks. Thankyou so much this trick worked......hurrayyyyy

satykumar36 avatar Jun 09 '20 15:06 satykumar36

Does not work for me. I do have netaddr installed. I can call netaddr from the command line without any issues. Still I get this error in a python script

File "test.py", line 1, in import netaddr ImportError: No module named netaddr

And yes. I installed netaddr with 3 different methods: No. 1 "sudo apt-get install python3-netaddr" No. 2 "pip install netaddr" No. 3 I downloaded it from Github and installed it.

As I said. I can start netaddr 0.80 - no problem. But I still have this error.

What is wrong?

betzburger avatar May 31 '22 17:05 betzburger

OK. Found the mistake. Python 2.x was active which was responsible for this error. Python 3.x worked fine.

betzburger avatar May 31 '22 17:05 betzburger