尝试调试.pyd文件时出现Pydev SytaxError

时间:2017-03-17 19:54:38

标签: python python-2.7 pycharm pydev

我正在尝试调试依赖于已编译的包的python脚本。它有一个__init __。pyd文件,当我加载到调试器中时,我得到:

Traceback (most recent call last):
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev\pydevd.py", line 1596, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
    File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev\pydevd.py", line 974, in run
pydev_imports.execfile(file, globals, locals) # execute the script
    File "C:\Program Files\Python27-13\lib\site-packages\package_name\module\__init__.pyd", line 1
SyntaxError: Non-ASCII character '\x90' in file C:\Program Files\Python27-13\lib\site-packages\package_name\module\__init__.pyd on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

该文件是二进制.pyd文件,因此错误有意义。我如何告诉PyCharm和Pydev不要尝试逐步浏览文件?我在pyCharm 2016.3.2中使用python 2.7。有什么提示吗?

谢谢,

1 个答案:

答案 0 :(得分:0)

您的 init 文件不应该是.pyd文件 What is __init__.py for?

用于初始化模块,它不是windows .dll
https://docs.python.org/3/faq/windows.html#is-a-pyd-file-the-same-as-a-dll