【发布时间】:2017-05-20 00:40:13
【问题描述】:
我一直在研究一些 makefile,它们调用一些 python 脚本来执行各种任务。到目前为止,我一直在安装 Ubuntu 16.04(64 位)的机器上makeing。今天,我尝试使用相同的 makefile 在 Lubuntu 16.04 的旧 32 位机器上构建,但在调用 Python 脚本时失败。
一开始我以为我的Python版本不够新,但是我也安装了Python 3.5,我在makefile中把行改成python3还是失败:
python3 /home/morane/Documents/Programming/ConnectX/cxPythonTools/RunUnitTests.py -t /home/morane/bin/tests/unit/cxUnitTests.out -l /home/morane/bin/tests/unit/log/unitTests.log
Traceback (most recent call last):
File "/home/morane/RunUnitTests.py", line 41, in <module>
from subprocess import CREATE_NEW_CONSOLE
ImportError: cannot import name 'CREATE_NEW_CONSOLE'
Makefile:51: recipe for target 'unittests' failed
make: *** [cxbaseunit] Error
为了测试,我尝试过直接在Python shell中重复报错:
Python 3.5.2+ (default, Sep 22 2016, 12:18:14)
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> from subprocess import CREATE_NEW_CONSOLE
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'CREATE_NEW_CONSOLE'
它仍然失败。有谁知道怎么回事?
问候
【问题讨论】: