子进程从PyDev意外崩溃,双击Windows资源管理器即可正常工作 [英] Subprocess crashes unexpectedly from PyDev, works fine from double click in windows explorer

查看:38
本文介绍了子进程从PyDev意外崩溃,双击Windows资源管理器即可正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了很多时间试图解决这个问题.我正在尝试调用此行来运行abaqus(FEA程序):

I've spent quite a bit of time trying to figure this out. I'm trying to invoke this line to run abaqus (an FEA program):

popen = subprocess.Popen(callCommand, cwd=workDir, creationflags=subprocess.CREATE_NEW_CONSOLE)
popen.wait()

双击.py文件,一切正常.但是,从Eclipse运行它时,Abaqus崩溃:

When double clicking on the .py file everthing works fine. However on running it from Eclipse, Abaqus crashes:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

然后,我还收到"SMAPython.exe停止工作"的信息.

Then later I also get "SMAPython.exe has stopped working".

我玩过管理员权限设置,但无济于事.没有代表用Abaqus对其进行标记.

I've played around with admin privilege settings but to no avail. Don't have the rep to tag it with Abaqus.

推荐答案

在这里找到了解决方案(在为问题写完草稿后就遇到了)

The solution (which I've come accross after writting a draft for the question) was found here:

http://sourceforge.net/p/pydev/discussion/293649/thread/94a76ecb/

基本上,PyDev添加了一些无法与Abaqus配合使用的环境变量,因此可以使用以下代码将其关闭:

Basically, PyDev adds some environment variables that don't play well with Abaqus, so to turn them off the following code can be used:

import os
try:
    os.environ.pop('PYTHONIOENCODING')
except KeyError:
    pass
# now call abaqus...

希望这对某人有用,我花了将近两天的时间来解决这个问题.PyDev的使用有点小众(我不是程序员,我是土木工程师),但我认为让Eclipse处理所有源文件的功能要强大得多.Abaqus CAE文件都是二进制文件和专有文件,因此,否则就很难进行源代码控制和自定义编辑.

Hopefully this is of use to someone, I've spent almost two days fixing this. It is a bit of a niche use of PyDev (I'm not a programmer, I'm a Civil Engineer) but I think it is much more powerful to have Eclipse take care of all the source files. Abaqus CAE files are all binary and proprietary so source control and custom edits are a pain otherwise.

我想在任何情况下,解决方案都是通过清除问题并检查有效的方法和差异之处来跟踪问题.

I guess in any case the solution is to trace the problem by taking bits of it off and checking what works and what the differences are.

这篇关于子进程从PyDev意外崩溃,双击Windows资源管理器即可正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆