scipy / scipy

SciPy library main repository
https://scipy.org
BSD 3-Clause "New" or "Revised" License
13.09k stars 5.19k forks source link

Issue while creating exe using cx_freeze with error throwing up in scipy.sparse.csgraph._shortest_path #9881

Closed vmadhukumar closed 5 years ago

vmadhukumar commented 5 years ago

My issue is about ...

Reproducing code example:

Sample code to reproduce the problem

Error message:

Traceback (most recent call last):
 File "C:\ProgramData\Anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
    module.run()
  File "C:\ProgramData\Anaconda3\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
    exec(code, m.__dict__)
  File "test.py", line 43, in <module>
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\__init__.py", line 134, in <module>
    from .base import clone
  File "C:\ProgramData\Anaconda3\lib\site-packages\sklearn\base.py", line 11, in <module>
    from scipy import sparse
  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\__init__.py", line 241, in <module>
    from .csgraph import cs_graph_components
  File "C:\ProgramData\Anaconda3\lib\site-packages\scipy\sparse\csgraph\__init__.py", line 167, in <module>
    from ._shortest_path import shortest_path, floyd_warshall, dijkstra,\
ImportError: cannot import name 'shortest_path'

### Scipy/Numpy/Python version information:
<!-- You can simply run the following and paste the result in a code block

import sys, scipy, numpy; print(scipy.version, numpy.version, sys.version_info) 0.19.1 1.15.1 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0) -->

rgommers commented 5 years ago

@vmadhukumar you will need to give us some more info. can you produce a self-contained example to reproduce this issue?

andyfaff commented 5 years ago

If you can do the imports in a normal interpreter then this will point to an issue with cx_freeze itself. I'm pretty sure this will be an issue with a cx_freeze recipe for scipy, you possibly need to specify it in include_files. I have no problems using pyinstaller with scipy. If you get a similar issue running code from the interpreter please feel free to reopen this issue.