0

I successfully installed pysnmp with yoaurt –S pysnmp, but when I try to execture a scipt with Python 2.7 which has import pysnmp, I get

$ python2.7 test_script.txt.py 
Traceback (most recent call last):
  File "test_script.txt.py", line 85, in <module>
    import pysnmp
ImportError: No module named pysnmp

any idea what is going wrong?

This might be too much, distracting oinformation, but my Arch Linux is in a VM and the company has severe restrictions on internet access from the VM. Both pacman and pip errored, but yaourt was successful

packages (1) pysnmp-4.3.1-1

Total Installed Size:  2.50 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring        [##########################] 100%
(1/1) checking package integrity      [##########################] 100%
(1/1) loading package files           [##########################] 100%
(1/1) checking for file conflicts     [##########################] 100%
(1/1) checking available disk space   [##########################] 100%
(1/1) reinstalling pysnmp             [##########################] 100%
  • I never use Arch but i think you can search the installed package path (rf: stackoverflow.com/questions/22681578/…), then use python -c "import sys; print(sys.path) to know your python's current search path. Then you will know the search path doesn't included your package path. – Fruit May 11 '16 at 12:36
0
sudo -E -- pacman -S python2 python2-pyasn1
yaourt -S python2-pysnmp

The -E on sudo uses the same enironment, which was necessary for me to get through the company's firewall. Omitting it causes a new process to be launched, which did not have network access. D'oh!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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