fortran可执行文件在命令行中运行,但不能通过python脚本运行

发布于 2025-02-10 01:57:12 字数 420 浏览 2 评论 0原文

我试图通过Python脚本运行一个Fortran可执行文件,但遇到了错误。我可以通过命令行运行可执行文件,但是当我在Spyder内运行此Python脚本时,它找不到某个文件。以下是我正在使用的代码行和输出错误:

process = subprocess.Popen(["./genex"])

错误:

dyld: Library not loaded: @rpath/libgfortran.3.dylib
Referenced from: /Users/Austin/tycho-1-14/run/./genex
Reason: image not found

编辑:

我找不到解决此特定问题的解决方案,但是我发现从命令行中运行Python脚本,而不是内部Spyder内部解决了问题。

I am trying to run a Fortran executable through a Python script but am getting an error. I can run the executable fine through the command line, but when I run this Python script inside Spyder it can't find a certain file. Below is the line of code I'm using and the output error:

process = subprocess.Popen(["./genex"])

error:

dyld: Library not loaded: @rpath/libgfortran.3.dylib
Referenced from: /Users/Austin/tycho-1-14/run/./genex
Reason: image not found

EDIT:

I did not find a solution to this particular problem, but I found that running the Python script from the command line instead of inside Spyder fixed the issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文