一个 import error 请教 - V2EX
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shyrock

一个 import error 请教

  •  
  •   shyrock Jul 9, 2014 4548 views
    This topic created in 4328 days ago, the information mentioned may be changed or developed.
    运行推荐引擎crab时,报错:
    C:\Python27\lib\site-packages\scipy\spatial\__init__.py in <module>()
    89 from .kdtree import *
    90 from .ckdtree import *
    ---> 91 from .qhull import *
    92 from ._plotutils import *
    93

    ImportError: DLL load failed: 找不到指定的模块。

    新人看不懂from .xxx import这个.是什么意思?
    另外这个错误应该怎么查呢?
    看了原始代码:
    87 from __future__ import division, print_function, absolute_import
    88
    89 from .kdtree import *
    90 from .ckdtree import *
    91 from .qhull import *
    92 from ._plotutils import *
    93
    94 __all__ = [s for s in dir() if not s.startswith('_')]
    95 __all__ += ['distance']

    貌似报错在空行?奇怪
    Supplement 1    Jul 9, 2014
    好吧,我明白 import .xxx 啥意思了。。。
    剩下的问题就是Import Error要怎么查,我看了这几个文件,没有提到有dll啊,不知道为啥报错是DLL load failed
    4 replies    2014-07-09 18:12:08 +08:00
    kaneg
        1
    kaneg  
       Jul 9, 2014   1
    应该是某个module中引入了一个native的库,你的环境是windows,所以是dll load failed。
    具体的原因还得看你的代码
    cakegg
        2
    cakegg  
       Jul 9, 2014   1
    暂时想到两个原因:

    1. 检查Package之间的依赖, 比如numpy之类的package可能也要安装
    2. 版本不对, 某些库的某些特性可能只支持Python 3.x
    shyrock
        3
    shyrock  
    OP
       Jul 9, 2014
    @kaneg 感谢回答。从报错看,是不是应该查92行?
    shyrock
        4
    shyrock  
    OP
       Jul 9, 2014
    找到问题了。。。scipy的spatial目录下少了qhull.py,不知道咋装的。。。
    而且因为新用IPython,没看懂报错信息:
    其实
    ---> 91 from .qhull import *
    这个箭头清晰说明了报错的行,我还在92行折腾了半天。。。
    About     Help     Advertise     Blog     API     FAQ     Solana     2975 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 34ms UTC 04:33 PVG 12:33 LAX 21:33 JFK 00:33
    Do have faith in whatyou're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86