python - 已安装 Python 2.7 和 Python 3.7。如何在 Python 2.7 中使用 MadGraph?
问题描述
我正在使用用 python 编写的模拟软件 MadGraph。MadGraph 仅与 python 2.7 兼容。我的 MadGraph 使用 Python 3.7.4 安装在 /mnt/c/1 文件夹中,正如我在 /mnt/c/1 目录中键入 ls 时看到的那样。但是当我输入 /mnt/c/1 目录 python --version 我得到 python 2.7.15+。在 /mnt/c/1MG5_aMC_v2_6_6 目录中,我键入 ls 但找不到 python。当我在同一目录中键入 which python 时,我得到 /usr/bin/python。当我输入 ls bin 时,我只得到 MadGraph 而没有 python。
我的问题是如何让 python 2.7 与 MadGraph 一起工作。我可以在一定程度上使用 MadGraph。当我想在 MadGraph 中输入某个命令时,我收到此错误:
Total: 4 processes with 4 diagrams
MG5_aMC>display diagrams
Drawing Process: u u~ > z > mu+ mu- WEIGHTED<=4 @1
Wrote file /tmp/diagrams_1_uux_z_mupmum.eps
open /tmp/diagrams_1_uux_z_mupmum.eps
Drawing Process: c c~ > z > mu+ mu- WEIGHTED<=4 @1
Wrote file /tmp/diagrams_1_ccx_z_mupmum.eps
open /tmp/diagrams_1_ccx_z_mupmum.eps
Drawing Process: d d~ > z > mu+ mu- WEIGHTED<=4 @1
Unhandled exception in thread started by <function call at
0x7fbbb476bc08>Wrote file /tmp/diagrams_1_ddx_z_mupmum.eps
Traceback (most recent call last):
open /tmp/diagrams_1_ddx_z_mupmum.eps
File "/usr/lib/python2.7/subprocess.py", line 172, in call
Drawing Process: s s~ > z > mu+ mu- WEIGHTED<=4 @1
Unhandled exception in thread started by <function call at 0x7fbbb476bc08>
Traceback (most recent call last):
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
Wrote file /tmp/diagrams_1_ssx_z_mupmum.eps
open /tmp/diagrams_1_ssx_z_mupmum.eps
raise child_exception
time to draw 0.063835144043
raise child_exception
OSErrorOSError: [Errno 2] No such file or directory: [Errno 2] No such
file or directory
MG5_aMC>
Unhandled exception in thread started by <function call at 0x7fbbb476bc08>
Traceback (most recent call last):
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Unhandled exception in thread started by <function call at 0x7fbbb476bc08>
Traceback (most recent call last):
File "/usr/lib/python2.7/subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
我不明白为什么我会为这个特定命令(显示模拟/生成的进程图)收到此操作系统错误。我可以很好地模拟这个过程,但我无法显示图表。我最终遇到了上面的错误,它卡住了,我必须按 ctrl+c。我想知道是不是因为我安装了不同的python版本。我只是想了解这个用 python 编写的错误以及如何修复它。我真的很感激一些帮助。谢谢!
解决方案
推荐阅读
- java - 如何将 log4j 每日日志轮换与基于文件大小的轮换和 maxbackup 结合起来?
- optimization - 如何缩短此代码或使其更高效?
- oauth - 找不到用于 Binance 登录的 OAuth 的 Client_id
- amazon-web-services - 无法在 ec2 CLI 上运行“aws configure”命令
- swift - 无法获得 WKWebView 的准确高度
- javascript - 如果某些或所有单词与 json 的键匹配,则在 json 中查找值
- javascript - 我正在尝试在 html 中添加一个 for 循环,?但 for 循环显示错误
- ios - 选择同一项目时,SwiftUI 三列导航布局未关闭
- css - 在播放前从嵌入的 youtube iframe 中的缩略图中隐藏“在 Youtube 上观看”
- sql-server - 将 Powershell 变量传递到 SQL INSERT