centos安裝python netsnmp擴展

1.下載setuptools-0.6c11-py2.7.egg(地址https://pypi.python.org/pypi/setuptools/0.6c11#downloads)

#添加執行權限
chmod +x setuptools-0.6c11-py2.7.egg
#執行腳本
./setuptools-0.6c11-py2.7.egg

2.安裝python-devel

yum install -y python-devel

3.下載net-snmp-5.7.3.tar.gz(地址:http://www.net-snmp.org/download.html

#解壓
tar -zxvf net-snmp-5.7.3.tar.gz
#進入文件夾
cd net-snmp-5.7.3
#編譯文件
./configure --prefix=/usr/local/netsnmp --with-python-modules
make && make install

4.在/etc/profile最後面加入

export PATH="/usr/local/netsnmp/bin:$PATH"

5.將庫文件目錄的路徑加入到/etc/ld.so.conf文件

echo "/usr/local/netsnmp/lib" >> /etc/ld.so.conf
ldconfig

6.編譯安裝python模塊

#進入python文件夾
cd python
python setup.py build
python setup.py test#可選,測試可能失敗,失敗後重新執行上一步,不再進行測試
python setup.py install
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章