简体   繁体   中英

Qt Creator refuses to execute Custom python program as a build step command

I'm writing a shared library, and in order to update the header files in my /usr/include dir, I wrote a python program to compare and keep the header files from the source directory up to date in the /usr/include directory, in hopes to have auto completion within the headers themselves on every build when I link them with my testing executable.

The problem is that Qt Creator fails to execute the python program. My settings are as follows:

Command : 'python'
Working Directory : '/path/to/python/file'
Args    : 'PythonFile.py'

Yes, the Enable custom process step box is checked.

My output resembles the following:

Could not start process "python " PythonFile.py

Granted, if there's another way to solve this header issue that is far more simpler (and includes the ability for the auto completion to be updated), I'm totally all ears.

Edit

I should also say I've executed the program via CLI and it works fine.

Update

Per updating the command according to Slava's suggestion, I got the following output:

Program is beginning
Traceback (most recent call last):
  File "UpdateHeaders.py", line 59, in <module>
    PROJECT_ROOT      = environ['ATLAS_PROJ_ROOT']
  File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'ATLAS_PROJ_ROOT'
13:08:35: The process "/usr/bin/env" exited with code 1.

Yet, if I run it via CLI I get this:

Program is beginning
Updating include directory on a UNIX based system, copying files from /home/amsterdam/Programming/atlas/Engine/AtlasEngine/ to /usr/include/atlas/Engine/
Found a source count of 5;
Found a dest count of 0
No headers have been copied to "/usr/include/atlas/Engine/", yet; copying now from "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/" 
Iterating through ['AtlasEngine.pro', 'GameObject.hpp', 'AtlasEngine_global.h', 'Type_Config.hpp', 'Rectangle.hpp', 'AtlasEngine.pro.user', 'Engine.hpp', 'Engine.cpp']
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/GameObject.hpp" to "/usr/include/atlas/Engine/GameObject.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/AtlasEngine_global.h" to "/usr/include/atlas/Engine/AtlasEngine_global.h"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Type_Config.hpp" to "/usr/include/atlas/Engine/Type_Config.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Rectangle.hpp" to "/usr/include/atlas/Engine/Rectangle.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Engine.hpp" to "/usr/include/atlas/Engine/Engine.hpp"

As shown, everything works fine without any errors unless it's ran through Qt Creator. Any suggestions?

Command : '/usr/bin/env'
Working Directory : '/path/to/python/file'
Args : 'python PythonFile.py'

要么

Command : '/usr/bin/env'
Args : 'python /path/to/python/file/PythonFile.py'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM