ImportError未定义符号PyUnicodeUCS2_FromObject

时间:2013-01-14 11:28:44

标签: c++ python qt

这是我的c ++代码片段(使用Qt),我在其中调用python-application的shell脚本:

void MainWindow::CodeAsterError()
{
    ui->textBrowserError->append(caProcess->readAllStandardError());
}

void MainWindow::CodeAsterOut()
{
    QByteArray byteArray = caProcess->readAllStandardOutput();
    QStringList strLines = QString(byteArray).split("\n");

    foreach (QString line, strLines)
    {
        ui->textBrowserOut->append(line);
    }
}

void MainWindow::on_pushButton_clicked()
{
    QString program = "/home/oogolov/aster/bin/as_run";
    QStringList arguments;
    arguments << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export";

    connect (caProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(CodeAsterOut()));
    connect (caProcess, SIGNAL(readyReadStandardError()), this, SLOT(CodeAsterError()));

    caProcess->start(program,arguments);
    // works too
    //caProcess->start("/bin/bash", QStringList() << "/home/oogolov/aster/bin/as_run" << "/home/oogolov/GeoFEA/GeoFEA2D/WorkDir/Calc.export");
    caProcess->waitForReadyRead(100);
}

当我运行(构建/运行)我的应用程序时,它运行良好。但是当我调试(调试/启动调试)时,我收到以下错误:


Traceback (most recent call last):
File "<string>", line 1, in <module>

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 109, in main start()

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/main.py", line 51, in start run = AsterRun()

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 186, in __init__ self.LoadExtensions()

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/run.py", line 297, in LoadExtensions import asrun.maintenance

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/maintenance.py", line 42, in <module> from asrun.build import AsterBuild

File "/home/oogolov/aster/lib/python2.7/site-packages/asrun/build.py", line 31, in <module> from zipfile import ZipFile

File "/opt/QtSDK/debugger/Desktop/lib/python2.7/zipfile.py", line 6, in <module> import io

File "/opt/QtSDK/debugger/Desktop/lib/python2.7/io.py", line 60, in <module> import _io

ImportError: /opt/QtSDK/debugger/Desktop/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_FromObject

你能帮我修一下这个“导入,PyUnicodeUCS2_FromObject”状态吗?

1 个答案:

答案 0 :(得分:2)

请点击semi-official Python FAQ

似乎您用于调试的Python构建与用于运行的Python构建不同。