错误:'python_ipc_popen2' 在第 62 行第 15 列附近未定义,当运行 Octave 时 [英] error: 'python_ipc_popen2' undefined near line 62 column 15 When running Octave
问题描述
尝试在 Mac 上运行 Octave.当我运行诊断命令 sympref 诊断
时.我知道一切都配置得很好:
Trying to run Octave on Mac. When I run the diagnose command sympref diagnose
. I get that everything is configured fine:
Symbolic package diagnostics
============================
Python and SymPy are needed for most features of the Symbolic package.
The Python interpreter is currently: "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3".
Computers may have more than one Python interpreter installed. If you
need to, you can select a different one using the PYTHON environment
variable (see "help sympref"). For example, to use Python 2, try
setenv PYTHON python2
sympref reset
Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "print(\"Python says hello\")"
status = 0
output = Python says hello
Good, Python ran correctly.
Python version
--------------
Let's check what version of Python we are calling...
Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import sys; print(sys.version)"
status = 0
output = 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50)
[Clang 6.0 (clang-600.0.57)]
SymPy Python Library
--------------------
SymPy is a Python library used by Symbolic for almost all features.
Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import sympy; print(sympy.__version__)"
status = 0
output = 1.6
SymPy must be at least version 1.2; you have version 1.6.
Good, a working version of SymPy is installed.
Python XML Parsing and DOM Support
----------------------------------
The XML DOM library is used by Symbolic for passing values to and from Python.
Some older versions of Python formatted XML output differently. As long as you
have any reasonably recent version of Python, this should pass.
Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import xml.dom.minidom as minidom; doc = minidom.parseString(\"<item>value</item>\"); print(doc.toprettyxml(indent=\"\"))"
status = 0
output = <?xml version="1.0" ?>
<item>value</item>
Your kit looks good for running the Symbolic package. Happy hacking!
但是一旦我尝试声明一个变量 syms x
我就会收到以下错误:
but as soon as I try to declare a variable syms x
I get the following error:
error: 'python_ipc_popen2' undefined near line 62 column 15
error: called from
python_ipc_driver at line 62 column 13
pycall_sympy__ at line 163 column 9
valid_sym_assumptions at line 38 column 10
assumptions at line 82 column 7
syms at line 97 column 13
推荐答案
好的,我已经找到了解决方法.超级奇怪.显然 Octave(或 SymPy,不完全确定)正在寻找一个名为 Python
的系统变量,它在文档中使用大写的 P 表示该变量应该是 蟒蛇
.无论如何设置 setenv Python
解决了这个问题.
Ok, I've found out how to solve it. Super strange.
Apparently Octave (or SymPy, not sure exactly) is looking for a system variable called Python
like this with a capital P in the docs it's said the variable should be PYTHON
. Anyway setting setenv Python <path to python>
solved the issue.
这篇关于错误:'python_ipc_popen2' 在第 62 行第 15 列附近未定义,当运行 Octave 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!