I run the script like this:
QProcess proс; proc.setProgram("cam\\python-3.5.2\\python.exe"); proc.setArguments(QStringList() << "cam\\Program\\rotronic-rcvr\\json.py"); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); proc.setProcessEnvironment(env); proc.setStandardErrorFile("error.log"); proc.setStandardOutputFile("output.log"); proc.setWorkingDirectory("cam\\python-3.5.2"); proc.start(); proc.waitForStarted(1000); After running python, it crashes right away. In the standard error stream displays the following:
Fatal Python error: unable to load the file system codec ImportError: No module named 'encodings'
Current thread 0x00004ed8 (most recent call first):
Moreover, if you run the script from the command line, for example, like this:
cam \ python-3.5.2 \ python.exe cam \ Program \ rotronic-rcvr \ json.py
then it runs without problems. What could be the problem?
json.py- jfs