52matlab技术网站,matlab教程,matlab安装教程,matlab下载

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 19416|回复: 0
打印 上一主题 下一主题

Mac环境运行python问题解决办法

[复制链接]

125

主题

209

帖子

3070

积分

版主

Rank: 7Rank: 7Rank: 7

积分
3070
跳转到指定楼层
楼主
发表于 2022-11-19 23:31:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在macos环境中时用python经常遇到
  1. OMP: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized.
  2. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://openmp.llvm.org/
复制代码
解决办法在脚本文件中的最前加上
  1. import os
  2. os.environ["KMP_DUPLICATE_LIB_OK"] = "True"
复制代码
解决!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|52matlab技术网站 ( 粤ICP备14005920号-5 )

GMT+8, 2024-11-22 11:33 , Processed in 0.062593 second(s), 19 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表