Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to install NetSNMP Python Bindings in Ubuntu 12.04 LTS system.

But I got some in install progress.

First, I got the net-snmp-5.7.1 source tar, and did the following things:

./configure --with-python-modules

apt-get install libperl-dev

But when I used the command ''make'' to compile the Net-SNMP source.

Facing the error like below:

Traceback (most recent call last): 
File "", line 2, in <module> 
from setuptools import setup, Extension, find_packages 
ImportError: No module named setuptools

I search some solutions, and someone use 'python-updater –i' to solve this problem.

But in my system, I don't have this command.

And the python version I use is 2.7.3

Can someone help me solve this problem?


share|improve this question

migrated from Mar 18 '13 at 10:33

This question came from our site for professional and enthusiast programmers.

sudo apt-get install python-setuptools. (And while you're at it, why not install python-pynetsnmp?)

share|improve this answer
Thanks for your replying.But I already install both python-setuptools and pynetsnmp, and I can't import netsnmp in python script.On the other hand, I also can't do 'python-updater –i. – Wayne Hong Mar 18 '13 at 17:24
Just like below. >>> import netsnmp Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named netsnmp – Wayne Hong Mar 18 '13 at 17:25

After I install python-setuptools,I faced the problem like below:

compilation terminated.
error: command 'gcc' failed with exit status 1
make: *** [pythonmodules] Error 1

And I solve by apt-get install python-dev

But when I compile the netsnmp module successfully, I faced the following problems:

error while loading shared libraries: cannot open shared object file: No such file or directory

And I solve it by cp /usr/local/lib/ /usr/lib

Now I can import netsnmp successfully.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.