

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Execute from Qlikview load script for Python file
Dear colleagues,
I have issue with Execute statement in load script when I try to run the python file.
Script runs with success when I run it without qlik (just pushed enter on it), or when I input it in cmd file and run from command file.
But it doesn't execute when I use Execute in Qlik load script. Even when I input python script file path in cmd file, and execute cmd.
I'm asking for help.
For information, I have already used this variants (doesn't work):
- EXECUTE C:\PycharmProjects\ODS_Data_Observer\data_observer.py;
- EXECUTE Python3 C:\PycharmProjects\ODS_Data_Observer\data_observer.py;
- EXECUTE cmd.exe /C C:\PycharmProjects\ODS_Data_Observer\New Text Document.cmd;
- EXECUTE C:\...\Python\Python36-32\python.exe C:\PycharmProjects\ODS_Data_Observer\data_observer.py;
"Can Execute External Programs" checkbox is enable.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved my issue. It works when Qlik application and script situated in the same folder.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
up


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should use double quotes in order to make it work...
For example i use the following excute command with success:
EXECUTE cmd.exe /c del "\\QLIKVIEW_SRV\E$\QV_CommonStorage\Actual_tmp.qvd";


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried this approach too, but it doesn't work.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
up


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anton.
Try this:
Execute cmd /C "cd E:\Qlikserver\03.Utils && python script.py"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anton
I often use Python in QV script and it works without any problems, also with parameters for python script.
For example:
set csvPath='$(sData)\$(sDataArea)\$(vVersion)\Export_PSP.csv';
Store PSP into [$(csvPath)](txt);
let csvPath=Replace('$(csvPath)','\','/');
set pythonExe = 'c:\Tools\WinPython-64bit-3.6.3.0Qt5\python-3.6.3.amd64\python.exe';
set pyScripts = '\\server\Scripts\Py';
EXECUTE $(pythonExe) $(pyScripts)\HR_Counter.py -csv "$(csvPath)";
- Christian


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is very weird situation.
In my local PC (at work) it doesn't works, but in server it works and in my home PC works too.
Maybe I should make additional tune in Windows?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
maybe I should make additional tune in Windows?
Because at one PC it works, and in another doesn't.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved my issue. It works when Qlik application and script situated in the same folder.
