Hi Kathy and thanks for the accurate review,
The problem is caused by a missing dependency that is python-nmap.
It is listed in requirements.txt but for some reason it is not installed in your system, you can solve this issue installing python-nmap with pip
File "/usr/local/lib/python2.7/site-packages/nmap/nmap.py", line 131, in __init__
PortScannerError: 'nmap program was not found in path. PATH is : /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
It looks like the python library (python-nmap) was installed (the exception comes from /usr/local/lib/python2.7/site-packages/nmap/nmap.py), but that that library depends on having nmap installed on the system. You can use a requirements.sh script to install that (see https://mycroft.ai/documentation/skills/skill-submission/#msm-compliance)
@KathyReid, if you want to test my theory that it’s not that the python library wasn’t installed, and instead that the system package is missing, you could try running sudo apt-get install nmap, and testing the skill again.
Hi @Christopher_Rogers, you are right, this is not said clearly on the library page but looking at the Debian Package we can see that nmap is needed, i added nmap installation in this commit
So, I’ve tried multiple times now to install this Skill, and each attempt has failed with msm error 122 - Running requirements.sh failed.
I did a bit of digging to see why requirements.sh failed and couldn’t figure it out - I tried both msm install https://github.com/Nhoya/skill-nmap.git and sudo msm install https://github.com/Nhoya/skill-nmap.git but both throw msm error 122.
So I took a look at requirements.sh. Using the bash script, the command that it tries to run is pi@mark_1:~ $ sudo apt install nmap
If I run this manually, it asks to confirm. I don’t want to run it, because then the msm install will work, but we won’t find out why requirements.sh doesn’t work.
So next I manually tried to execute requirements.sh. I couldn’t do this at all, with permission denied errors. I tried to do sudo su mycroft, and tried again. Still no good. Then I dook a look at the filesystem permissions:
pi@mark_1:/opt/mycroft/skills/skill-nmap $ ls -las
total 48
4 drwxr-xr-x 5 mycroft mycroft 4096 Mar 22 12:30 .
4 drwxrwxrwx 42 mycroft mycroft 4096 Mar 22 12:30 ..
4 drwxr-xr-x 8 mycroft mycroft 4096 Mar 22 12:30 .git
4 -rw-r--r-- 1 mycroft mycroft 1143 Mar 22 12:30 __init__.py
4 -rw-r--r-- 1 mycroft mycroft 1870 Mar 22 12:30 __init__.pyc
4 -rw-r--r-- 1 mycroft mycroft 1057 Mar 22 12:30 LICENSE
4 -rw-r--r-- 1 mycroft mycroft 67 Mar 22 12:30 README.md
4 drwxr-xr-x 3 mycroft mycroft 4096 Mar 22 12:30 regex
4 -rw-r--r-- 1 mycroft mycroft 665 Mar 22 12:30 requirements.sh
4 -rw-r--r-- 1 mycroft mycroft 12 Mar 22 12:30 requirements.txt
4 -rw-r--r-- 1 mycroft mycroft 35 Mar 22 12:30 settings.json
4 drwxr-xr-x 3 mycroft mycroft 4096 Mar 22 12:30 vocab
The requirements.sh file is set to 644 - it’s not executable. So I changed it to 744, which added the executable flag, but I still couldn’t get it to execute manually.
I’m going to ping King @forslund here in case he has any ideas.
TL;DR - I think this is a permissions issue and that’s why requirements.sh is not executing.
Yea, I think I have the solution, in requirements.sh i’m missing #!/bin/bash since I usually run calling it with the interpreter (bash requirements.sh) Calling bash inside requirements.sh should fix the issue
found_exe() {
hash "$1" 2>/dev/null
}
# On a Mark 1 the installation process is often running under a limited
# user named 'mycroft'. So avoid apt-get for installing packages.
# polkit uses pkcon instead of apt-get; pkcon will then run apt-get
if found_exe pkcon; then
pkcon package
fi
I just tried this on a mark1, 18.08r9. Same error. Is this a problem that has been solved, but requires changes to requirements.sh? Or is this still an unsolved problem?
I think this could be a really great skill, and help demonstrate one the key differences between Mycroft and the competition (i.e., intent fulfillment from the device itself is possible, even normal/default case).
(mycroft-core) pi@mark_1:~ $ sudo msm install https://github.com/Nhoya/nmap-skill
WARNING - No such default skill: plasma-user-control-skill
INFO - Downloading skill: https://github.com/Nhoya/nmap-skill
Resolving [=========================]
Installing [=========================]
Loading cache [=========================]
Finished [=========================]
Fatal error: The following packages have unmet dependencies:
nmap: Depends: liblinear1 (>= 1.6) but it is not going to be installed
Recommends: ndiff but it is not going to be installed
Resolving [=========================]
Installing [=========================]
Loading cache [=========================]
Finished [=========================]
Fatal error: The following packages have unmet dependencies:
liblinear1: Depends: libblas3 but it is not going to be installed or
libblas.so.3
Resolving [=========================]
Installing [=========================]
Loading cache [=========================]
Finished [=========================]
Fatal error: The following packages have unmet dependencies:
libblas3: Depends: libgfortran3 (>= 4.3) but it is not going to be installed
ERROR - Requirements.sh failed with error code: 7
SystemRequirementsException: 7
Yes, I think this Skill needs some changes to requirements.sh - unfortunately I don’t have time to dig into this at the moment.