安装python-nmap报错,pip和源码安装都是报错

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

zhanghbTT

2021-11-30

pip install python-nmap
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting python-nmap
Using cached python-nmap-0.7.1.tar.gz (44 kB)
ERROR: Command errored out with exit status 1:
command: /usr/local/python/bin/python -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-mcOpDm/python-nmap/setup.py’"’"’; file=’"’"’/tmp/pip-install-mcOpDm/python-nmap/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ egg_info --egg-base /tmp/pip-pip-egg-info-NjvMSC
cwd: /tmp/pip-install-mcOpDm/python-nmap/
Complete output (10 lines):
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-mcOpDm/python-nmap/setup.py”, line 21, in
from nmap import *
File “nmap/init.py”, line 41, in
from .nmap import * # noqa
File “nmap/nmap.py”, line 137
f"nmap program was not found in path. PATH is : {os.getenv(‘PATH’)}"
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

写回答

1回答

Jeson

2021-12-10

nmap program was not found in path. PATH is : {os.getenv(‘PATH’)}"

可以看看这个提示,指的是nmap这个命令没有安装。


0
0

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

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

861 学习 · 326 问题

查看课程