我在Linux下使用Cython编译自制的python扩展。在Linux上,我使用distutils生成一个“我的下一个,然后我可以简单地将其添加到我的PYTHONPATH
中并获得import myext
python调用。在
现在,我正在尝试让它在Windows7下工作(使用Cython0.18)。
我成功地运行了distutils,现在我得到了一个myext.pyd
文件。但似乎(http://docs.python.org/2/faq/windows.html#is-a-pyd-file-the-same-as-a-dll)将路径添加到“我的文字.pyd“在窗户下面是不够的。什么应该是“我的下一页“看起来,或者换句话说,在Python(2.7)安装中获得可用扩展的过程是什么。在
注意:添加包含我的文字.pyd“对于Python,我仍然得到:
python BdmLsim4.py -i model.xml
Traceback (most recent call last):
File "BdmLsim4.py", line 6, in <module>
import myext
ImportError: DLL load failed: module not found.
非常感谢。在
你链接的文档中清楚地写着:
因此,您应该将}所在的目录。在
.pyd
文件放在python的安装目录(site-packages
)中,或者修改环境变量PYTHONPATH
,并添加{另一种选择是使用
.pth
文件来扩展PYTHONPATH
。在相关问题 更多 >
编程相关推荐