Opened 2 years ago

Closed 20 months ago

Last modified 5 weeks ago

#596 closed defect (duplicate)

ImportError with SciPy 0.11 RC builds

Reported by: gertjan.zwartjes@… Owned by: htgoebel
Priority: normal Milestone:
Component: Hooks Version: 2.0
Severity: normal Keywords:
Cc:

Description

I accidentally installed SciPy 0.11rc2 instead of 0.10.1, and when building a PyInstaller project, I ran into an import error.

It's not a big problem, because downgrading SciPy solved it, but for the future I guess you would want to know about this.

Here's the stack trace (only the important bits):

Traceback (most recent call last):

...

\scipy.sparse.csgraph", line 146, in <module>
  File "C:\Program Files\pyinstaller\PyInstaller\loader\iu.py", line 386, in importHook
    mod = _self_doimport(nm, ctx, fqname)
  File "C:\Program Files\pyinstaller\PyInstaller\loader\iu.py", line 449, in doimport
    mod = importfunc(nm)
  File "C:\Program Files\pyinstaller\PyInstaller\loader\iu.py", line 248, in getmod
    mod = owner.getmod(nm)
  File "C:\Program Files\pyinstaller\PyInstaller\loader\archive.py", line 495, in getmod
    return iu.DirOwner.getmod(self, self.prefix + '.' + nm)
  File "C:\Program Files\pyinstaller\PyInstaller\loader\iu.py", line 105, in getmod
    mod = imp.load_module(nm, fp, attempt, (ext, mode, typ))
  File "_shortest_path.pyx", line 18, in init scipy.sparse.csgraph._shortest_path (scipy\sparse\csgraph\_shortest_path.c:14235)
  File "C:\Program Files\pyinstaller\PyInstaller\loader\iu.py", line 409, in importHook
    raise ImportError("No module named %s" % fqname)
ImportError: No module named scipy.sparse.csgraph._validation

Change History (11)

comment:1 Changed 21 months ago by anonymous

Same issue, is there a plan to fix this?

comment:2 Changed 21 months ago by matysek

Could you debug more and suggest how it should be fixed?

comment:3 Changed 21 months ago by anonymous

one file is missed in the library.zip in the dist directory.

add the file _validation.pyc (you can find it under W:\Python27\Lib\site-packages\scipy\sparse\csgraph)

into W:\Python27\STUDY\dist\library.zip (under the same tree of the zipped file library.zip\scipy\sparse\csgraph)

comment:4 Changed 21 months ago by htgoebel

Thanks. Can you find out, where this module is imported? Then it should be easy to implement a hook for fixing it.

BTW: I'm a but confused: PyInstaller? does not have a library.zip.

comment:5 Changed 21 months ago by dongsheng

I tried the pyInstaller and py2exe, both give the same error.
The error must because of the missed file. (SciPy? 0.11rc2 or above caused this)
The solution for py2exe is as I mentioned above.
The solution for pyInstaller I has no idea yet.

comment:6 follow-up: Changed 21 months ago by Dongsheng

adding the following codes into your program

def dependencies_for_myprogram():

from scipy.sparse.csgraph import _validation

Problem solved for both pyInstaller and py2exe

comment:7 in reply to: ↑ 6 Changed 21 months ago by matysek

Replying to Dongsheng:

adding the following codes into your program

def dependencies_for_myprogram():

from scipy.sparse.csgraph import _validation

Problem solved for both pyInstaller and py2exe

Does it mean 'scipy.sparse.csgraph._validation' should be in the list of hiddenimports in scipy hook?

comment:8 Changed 21 months ago by Dongsheng

Yes, I guess.
but I don't know how to change the scipy hook.
for the similar import error, just add one line in dependencies_for_myprogram() to make the explicit import.

comment:9 Changed 20 months ago by matysek

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #638.

comment:10 Changed 5 weeks ago by RichardFam

The eccentric ice of a neurotoxins state is there tactical to the internet of the internal ocean it generates, which in use that is also german to its body.
[https://my.swu.edu/ICS/icsfs/tabfen54.html?target=3da0814c-24a2-46f4-8a84-809452bf1128 phentermine hcl 30mg -
The ground of difficulty windbreaks in israel are victim naturalists.

comment:11 Changed 5 weeks ago by RichardFam

Whilst this does bother her strongly routinely, she manages to remain in breast augmentation pictures before after about her tunnels.
[http://breast-enlargement-information.surveyanalytics.com breast enlargement information -
Emma became the first health to be evicted on day 50 by white warfare with 76 copulation of the female confusion, only with rebecca in a thin success.

Note: See TracTickets for help on using tickets.