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%
1
  • 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. Commented May 11, 2016 at 12:36

1 Answer 1

1
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!

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.