Getting Data In

Why am I receiving a "No such file or directory" error when trying to run the Splunk AppInspect tool on Windows?

simpkins1958
Contributor

Followed all the installation steps from http://dev.splunk.com/view/appinspect/SP-CAAAFAN

Only issue I had was with LXML, adm64 would not install but win32 did. Python reported that splunk-appinspect was installed OK.

But when try and run splunk-appinspect get the error below. Any suggestions on getting this to work?

c:\Temp>python splunk-appinspect --help
python: can't open file 'splunk-appinspect': [Errno 2] No such file or directory

c:\Temp>pip install lxml-3.6.4-cp27-cp27m-win_amd64.whl
lxml-3.6.4-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

c:\Temp>pip install lxml-3.6.4-cp27-cp27m-win32.whl
Processing c:\temp\lxml-3.6.4-cp27-cp27m-win32.whl
Installing collected packages: lxml
Successfully installed lxml-3.6.4

c:\Temp>pip install splunk-appinspect-1.2.0.73.tar.gz
Processing c:\temp\splunk-appinspect-1.2.0.73.tar.gz
Collecting beautifulsoup4==4.5.1 (from splunk-appinspect==1.2.0.73)
  Downloading beautifulsoup4-4.5.1-py2-none-any.whl (83kB)
    100% |################################| 92kB 380kB/s
Collecting click==6.6 (from splunk-appinspect==1.2.0.73)
  Downloading click-6.6.tar.gz (283kB)
    100% |################################| 286kB 568kB/s
Collecting futures==3.0.5 (from splunk-appinspect==1.2.0.73)
  Downloading futures-3.0.5-py2-none-any.whl
Collecting futures-then==0.1.1 (from splunk-appinspect==1.2.0.73)
  Downloading futures_then-0.1.1.tar.gz
Collecting humanfriendly==1.44.7 (from splunk-appinspect==1.2.0.73)
  Downloading humanfriendly-1.44.7.tar.gz (45kB)
    100% |################################| 51kB 501kB/s
Collecting langdetect==1.0.6 (from splunk-appinspect==1.2.0.73)
  Downloading langdetect-1.0.6.zip (995kB)
    100% |################################| 1.0MB 350kB/s
Requirement already satisfied: lxml==3.6.4 in c:\python27\lib\site-packages (fro
m splunk-appinspect==1.2.0.73)
Collecting Markdown==2.6.6 (from splunk-appinspect==1.2.0.73)
  Downloading Markdown-2.6.6.zip (412kB)
    100% |################################| 419kB 533kB/s
Collecting painter==0.3.1 (from splunk-appinspect==1.2.0.73)
  Downloading painter-0.3.1.tar.gz
Collecting py==1.4.31 (from splunk-appinspect==1.2.0.73)
  Downloading py-1.4.31-py2.py3-none-any.whl (81kB)
    100% |################################| 92kB 1.4MB/s
Collecting pytest==3.0.0 (from splunk-appinspect==1.2.0.73)
  Downloading pytest-3.0.0-py2.py3-none-any.whl (168kB)
    100% |################################| 174kB 1.4MB/s
Collecting six==1.10.0 (from splunk-appinspect==1.2.0.73)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting colorama (from painter==0.3.1->splunk-appinspect==1.2.0.73)
  Downloading colorama-0.3.7-py2.py3-none-any.whl
Installing collected packages: beautifulsoup4, click, futures, futures-then, hum
anfriendly, six, langdetect, Markdown, colorama, painter, py, pytest, splunk-app
inspect
  Running setup.py install for click ... done
  Running setup.py install for futures-then ... done
  Running setup.py install for humanfriendly ... done
  Running setup.py install for langdetect ... done
  Running setup.py install for Markdown ... done
  Running setup.py install for painter ... done
  Running setup.py install for splunk-appinspect ... done
Successfully installed Markdown-2.6.6 beautifulsoup4-4.5.1 click-6.6 colorama-0.
3.7 futures-3.0.5 futures-then-0.1.1 humanfriendly-1.44.7 langdetect-1.0.6 paint
er-0.3.1 py-1.4.31 pytest-3.0.0 six-1.10.0 splunk-appinspect-1.2.0.73
0 Karma

warrenfelsh
New Member

To get rid of this error you can try using Python file exists methods to check that at least python sees the file exists or not. In other words, you can make sure that the user has indeed typed a correct path for a real existing file. If the user does not pass the full path to the file, the path is interpreted relatively to the current working directory. The current working directory usually is the directory in which you started the program.

You have three options:

  • Use an absolute path to open the file.
  • Generate the path to the file relative to your python script.
  • Change the current working directory before opening the file
0 Karma

simpkins1958
Contributor

Will run if started from the Scripts folder, even though it is in the PATH.

C:\Python27\Scripts>python splunk-appinspect inspect NetMotionDazzlerApp.tgz --mode precert --included-tags splunk_appinspect

PATH=C:\Python27\;C:\Python27\Scripts;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Users\NetMotionTest\AppData\Local\Microsoft\WindowsApps;

mmacvicar_splun
Splunk Employee
Splunk Employee

Yes, "python splunk-appinspect" won't work in Windows unless “splunk-appinspect” is in the current directory (Note: Windows Command Prompt searches the PATH for the “python” command, but only searches the current directory for arguments.)

0 Karma
Get Updates on the Splunk Community!

Synthetic Monitoring: Not your Grandma’s Polyester! Tech Talk: DevOps Edition

Register today and join TekStream on Tuesday, February 28 at 11am PT/2pm ET for a demonstration of Splunk ...

Instrumenting Java Websocket Messaging

Instrumenting Java Websocket MessagingThis article is a code-based discussion of passing OpenTelemetry trace ...

Announcing General Availability of Splunk Incident Intelligence!

Digital transformation is real! Across industries, companies big and small are going through rapid digital ...