V2EX = way to explore
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
oldbird
V2EX  ›  Python

import numpy 直接运行没问题,调试报错

  •  
  •   oldbird · 2019-11-17 23:24:44 +08:00 · 5940 次点击
    这是一个创建于 1593 天前的主题,其中的信息可能已经有所发展或是发生改变。

    vscode 中,解释器是 anaconda 下的一个虚拟环境,py 文件中 import numpy,调试时报错: from numpy.core._multiarray_umath import ( ImportError: DLL load failed: 找不到指定的模块。 Importing the numpy c-extensions failed

    但直接运行可以正常通过, 不知道怎么回事

    3 条回复    2019-11-18 11:53:09 +08:00
    ClericPy
        1
    ClericPy  
       2019-11-18 00:12:47 +08:00
    猜测解释器不一致

    import sys
    print(sys.executable)

    看看二者是不是同一个
    lovestudykid
        2
    lovestudykid  
       2019-11-18 00:31:46 +08:00
    这个不是很显然的 bug 么,失败之后,你马上再点一下调试看看。
    https://github.com/microsoft/vscode-python/issues/4300
    kcirtap
        3
    kcirtap  
       2019-11-18 11:53:09 +08:00 via iPhone
    Python 是最好的两门语言
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2763 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 12:49 · PVG 20:49 · LAX 05:49 · JFK 08:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.