python27.def“未找到符号表"尝试编织时 [英] python27.def "Symbol table not found" when trying weave

查看:206
本文介绍了python27.def“未找到符号表"尝试编织时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Weave与Python ANACONDA 64位一起使用.由于编织需要Python 2.7,因此我创建了一个新的env来导入它,在代码执行过程中,事实证明缺少libpython27.a.所以我创建了这个库,即第一个创建了def文件,后来又使用dll工具创建了库

I'm trying to use weave with Python ANACONDA 64 bit. As weave requires Python 2.7 i created a new env to be able to import it, during code execution it turned out that libpython27.a is missing. So I created this library i.e. 1st created def file and later library with dll tool

C:\ProgramData\Anaconda3\envs\Python27>gendef python27.dll

C:\ProgramData\Anaconda3\envs\Python27>C:\MinGW64\bin\dlltool -v --dllname python27.dll --def python27.def --output-lib libpython27.a

库创建很好,但是在编织过程中,我找不到符号表.经过一些调试之后,这里有一个拒绝代码,抱怨它在新的python27.def中没有符号文件

library creation went OK however during comlipaton by weave i'm getting Symbol table not found. After a bit of debbuging here is a code which reject is complaining that in new python27.def there is no symbol file

File "C:\ProgramData\Anaconda3\envs\Python27\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 302, in generate_def
    raise ValueError("Symbol table not found")

ValueError: Symbol table not found

def dump_table(dll):
    st = subprocess.Popen(["objdump.exe", "-p", dll], stdout=subprocess.PIPE)
    return st.stdout.readlines()

def generate_def(dll, dfile):
    """Given a dll file location,  get all its exported symbols and dump them
    into the given def file.

    The .def file will be overwritten"""
    dump = dump_table(dll)
    for i in range(len(dump)):
        if _START.match(dump[i].decode()):
            break
    else:
        raise ValueError("Symbol table not found")

有什么想法吗??

推荐答案

经过更多调查,Anaconda发行版似乎提供了msvcr90.dll而没有 符号表.因此,当调用msvcr90.dll的generate_def(dll,dfile)时,它将生成一个空的def文件.

After more investigations it looks like Anaconda distribution delivers msvcr90.dll without symbol table. So when generate_def(dll, dfile) for msvcr90.dll in invoked it generates empty def file.

修复该问题的方法是在第352行mingw32compiler.py中添加返回False

fix for it was in line 352 mingw32compiler.py to add return False

def build_msvcr_library(debug=False):
    return False
    if os.name != 'nt':
        return False

这篇关于python27.def“未找到符号表"尝试编织时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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