py2exe with scipy.sparse.sparsetools.csr

北城余情 提交于 2019-12-23 02:35:06

问题


I get the following error message using python v2.7.3 and scipy v0.11.0 with py2exe v0.6.9:

ImportError: No module named _csr

my setup.py:

from distutils.core import setup
import py2exe


setup(console=['demo.py'],
  options = {
             "py2exe": {"includes":["scipy.sparse", "scipy.sparse.sparsetools.csr",
                                    "scipy.sparse.sparsetools._csr"]}
             })

The question in scipy with py2exe couldn't helped me out.


回答1:


There are two reasons I can think of for why you might have gotten this error.

  1. _csr.pyd should normally live in \Python2.7\Lib\site-packages\scipy\sparse\sparsetools. It is possible that for some reason it is not there - an easy fix could be to reinstall Scipy.
  2. During the call to setup, a scipy.sparse.sparsetools._csr.py file is generated. This file makes a call to imp.load_dynamic, attempting to load the PYD file. This function can throw an ImportError, which could be a symptom of a missing file.

If this does not resolve the problem, it would be great if you could post the output (i.e., what gets printed to the DOS prompt) of python setup.py py2exe - this should help narrow things down.



来源:https://stackoverflow.com/questions/14225124/py2exe-with-scipy-sparse-sparsetools-csr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!