老师,安装python-nmap 时候有如下报错

来源:4-6 python-nmap模块的使用

sunshinebao

2018-05-08

In [3]: nm = nmap.PortScanner()
---------------------------------------------------------------------------
PortScannerError                          Traceback (most recent call last)
<ipython-input-3-a2bd5eab1e32> in <module>()
----> 1 nm = nmap.PortScanner()


/opt/python2.7/lib/python2.7/site-packages/nmap/nmap.pyc in __init__(self, nmap_search_path)
    129             raise PortScannerError(
    130                 'nmap program was not found in path. PATH is : {0}'.format(
--> 131                     os.getenv('PATH')
    132                 )
    133             )


PortScannerError: 'nmap program was not found in path. PATH is : /opt/python2.7/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'


In [4]: q
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-4-e222fcdf3350> in <module>()
----> 1 q


NameError: name 'q' is not defined


In [5]: bye
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-ee9e51458f46> in <module>()
----> 1 bye


NameError: name 'bye' is not defined


In [6]: quit
root@ubuntu:~# /opt/python2.7/bin/pip install python-nmap
Requirement already satisfied: python-nmap in /opt/python2.7/lib/python2.7/site-packages (0.6.1)
xadmin 0.6.1 has requirement django<2.0.0,>=1.9.0, but you'll have django 1.8.2 which is incompatible.


写回答

1回答

Jeson

2018-05-08

Requirement already satisfied: python-nmap in /opt/python2.7/lib/python2.7/site-packages (0.6.1)

这个说明已经安装上了,不是安装报错。

0
0

Python+Django+Ansible Playbook自动化运维项目实战

【课程升级3.6版本】大牛全面践行DevOps,运维与开发间高效协作

861 学习 · 326 问题

查看课程