futureimperfect / futureimperfect_scripts

Scripts for sharing.
17 stars 2 forks source link

ImportError: No Module named netaddr #1

Open n0brainer opened 7 years ago

n0brainer commented 7 years ago

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 commented 7 years ago

this is for the cidr_to_range script btw

futureimperfect commented 7 years ago

Hi @n0brainer,

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

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

Thanks.

satykumar36 commented 4 years ago

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

betzburger commented 2 years ago

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 commented 2 years ago

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