import numpy
print "asdf"
当我在Visual Studio Code中尝试调试/运行上述Python代码时,我会遇到以下错误(使用OSX)
ImportError,无法导入float96名称
如何解决?
我已从Python网站安装了Python。也尝试了从brew安装后运行,但没有效果。
编辑
所有针对Visual Studio的导入都存在问题。
import numpy
print "asdf"
当我在Visual Studio Code中尝试调试/运行上述Python代码时,我会遇到以下错误(使用OSX)
ImportError,无法导入float96名称
如何解决?
我已从Python网站安装了Python。也尝试了从brew安装后运行,但没有效果。
编辑
所有针对Visual Studio的导入都存在问题。
这是调试器的一个问题,它加载模块的方式可能会导致一些导入错误,但这些错误是可以安全忽略的。
为了忽略这些错误,请进入 launch.json 文件,并进行以下编辑(添加忽略“ImportError”部分):
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${file}",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
],
"exceptionHandling": {
"ignore": ["ImportError"]
}
},
我遇到了这个问题,因为我在系统中安装了Anaconda并且正在尝试删除它。一旦我从shell中清除了所有Anaconda的痕迹,它就开始正常工作了!