I'm trying to install Zenmap after installing Nmap however it's not quite working. I tried just the regular terminal command dnf install zenmap however it tells me that they're unable to find a match.

I then went to the official website to download the RPM file and tried using the command 'rpm -i filename.rpm' which told me I needed to download PyGTK which I did and it worked. However, now when I try to run zenmap, it shows me

File "/usr/bin/zenmap", line 182 except ImportError, e: SyntaxError: invalid syntax

When I try launching zenmap from the search, it shows Zenmap GUI port Scanner but when I try clicking on it, there's a brief flash on my screen and then it's gone. I tried looking for solutions but there's only 2 when I search and neither of them has an answer to it.

I'm using Fedora 31 with KDE Plasma.

1 Answer 1


Apparently Zenmap reached EOL in F28 because it relies on now deprecated Python 2.
See the issue on github: Zenmap and Ndiff are python2 only #1176

You should still be able to make it work by installing (deprecated) Python 2 and the necessary modules.

If I look at the source code zenmap relies on /usr/bin/env python, which on your system would normally default to Python 3 instead of Python 2 and that's probably why you are having that syntax error. Either edit the launchers or explicitly call Zenmap with python2 eg: python2 /path/to/zenmap.

  • Thank you! I called Zenmap with Python2 and it worked perfectly. May 6, 2020 at 22:08

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.